Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
HDFS >> mail # user >> HDFS on 0.20.203


+
Arko Provo Mukherjee 2011-08-31, 08:13
+
Arun C Murthy 2011-09-01, 07:24
+
Arko Provo Mukherjee 2011-09-01, 14:52
+
Arun Murthy 2011-09-01, 15:14
+
Sudharsan Sampath 2011-09-02, 04:42
Copy link to this message
-
Re: HDFS on 0.20.203
Hi,

Many thanks for your kind reply.

I switched to 0.203.0 as per the advice of Arun Murthy.

Also I replaced import org.apache.hadoop.*; by
importorg.apache.hadoop.fs.*; as per the advice of Sudharsan.

Now I get just one error:
FileTest.java:19: cannot find symbol
symbol  : class Configuration
location: class FileTest
                FileSystem fs = FileSystem.get(new Configuration());

Am I missing some other import statements?

Many thanks in advance!
Warm Regards
Arko

On Thu, Sep 1, 2011 at 11:42 PM, Sudharsan Sampath <[EMAIL PROTECTED]>wrote:

> Hi,
>
> Some of your imports are incorrect. Both FileSystem and Path classes are
> present in o.a.h.fs
>
> Thanks
> Sudhan S
>
> On Thu, Sep 1, 2011 at 8:22 PM, Arko Provo Mukherjee <
> [EMAIL PROTECTED]> wrote:
>
>> Hi,
>>
>> My code looks like this:
>>
>> *import java.util.*;*
>>
>> *import java.lang.*;*
>>
>> *import java.io.*;*
>>
>> *import org.apache.hadoop.*;*
>>
>> *
>> *
>>
>> *class MapReduce  {*
>>
>> *    *
>>
>> *public static void main(String[] args) throws Exception  {*
>>
>> **
>>
>> *        try  {*
>>
>> *                Path pt=new Path(
>> "hdfs://localhost:54310//Users/arko/Documents/Research/HDFS/abc");*
>>
>> *                FileSystem fs = FileSystem.get(new Configuration());*
>>
>> *                BufferedWriter br=new BufferedWriter(new
>>  OutputStreamWriter(fs.create(pt,true)));*
>>
>> *                String line;*
>>
>> *                line="Testing";*
>>
>> *                System.out.println(line);*
>>
>> *                br.write(line);*
>>
>> *                br.close();*
>>
>> *        }catch(Exception e){*
>>
>> *                System.out.println("File not found");*
>>
>> *        }*
>>
>> *    }*
>>
>> *}*
>>
>> When I compile the code, I get the following erros:
>> *$javac -classpath
>> /Users/arko/Documents/hadoop-0.21.0/hadoop-common-0.21.0.jar -d class/
>> FileSystemCat.java clear*
>>
>> FileTest.java:16: cannot find symbol
>> symbol  : class Path
>> location: class FileTest
>>                 Path pt=new
>> Path("hdfs://localhost:54310//Users/arko/Documents/Research/HDFS/abc");
>>                 ^
>> FileTest.java:16: cannot find symbol
>> symbol  : class Path
>> location: class FileTest
>>                 Path pt=new
>> Path("hdfs://localhost:54310//Users/arko/Documents/Research/HDFS/abc");
>>                             ^
>> FileTest.java:17: java.io.FileSystem is not public in java.io; cannot be
>> accessed from outside package
>>                 FileSystem fs = FileSystem.get(new Configuration());
>>                 ^
>> FileTest.java:17: cannot find symbol
>> symbol  : class Configuration
>> location: class FileTest
>>                 FileSystem fs = FileSystem.get(new Configuration());
>>                                                    ^
>> FileTest.java:17: java.io.FileSystem is not public in java.io; cannot be
>> accessed from outside package
>>                 FileSystem fs = FileSystem.get(new Configuration());
>>                                 ^
>> 5 errors
>>
>>
>> Also I would like to learn the FileContext API as I want to use 0.21 for
>> making appends to my file in each MR round.
>> Would be great if you have a place where I can have a look at some code
>> snippets that have demonstrated the use of FileContext for easy learning.
>>
>> Many thanks in advance!
>> Warm regards
>> Arko
>>
>> On Thu, Sep 1, 2011 at 2:24 AM, Arun C Murthy <[EMAIL PROTECTED]>wrote:
>>
>>> What kind of example code are you looking for? It will help if you
>>> describe your use case...
>>>
>>> On Aug 31, 2011, at 1:13 AM, Arko Provo Mukherjee wrote:
>>>
>>> > Hi,
>>> >
>>> > I am using HDFS on 0.20.203 for my project.
>>> >
>>> > I can see the API has evolved much over the different versions.
>>> >
>>> > Can you please guide me to some link where I can find some example code
>>> for any version >= 0.20.203 so that I can quick start the process.
>>> >
>>> > Thanks much in advance!
>>> >
>>> > Warm regards
>>> > Arko
>>>
>>>
+
Arko Provo Mukherjee 2011-09-02, 06:27
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB