You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by unmesha sreeveni <un...@gmail.com> on 2013/11/30 09:54:06 UTC

Folder creation using Path in MR java code

Hi all
         How to create a folder in hdfs using java code

I tried

Path folder = new Path("dir1");

But it is not created in hdfs. And i also tried it in eclipse. There also
the folder is not creating.


-- 
*Thanks & Regards*

Unmesha Sreeveni U.B

*Junior Developer*

Re: Folder creation using Path in MR java code

Posted by Ted Yu <yu...@gmail.com>.
Take a look at this API (and its variants):
http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#create(org.apache.hadoop.fs.Path,%20boolean)

On Nov 30, 2013, at 12:54 AM, unmesha sreeveni <un...@gmail.com> wrote:

> Hi all
>          How to create a folder in hdfs using java code
> 
> I tried
> 
> Path folder = new Path("dir1");
> 
> But it is not created in hdfs. And i also tried it in eclipse. There also the folder is not creating.
>  
> 
> -- 
> Thanks & Regards
> 
> Unmesha Sreeveni U.B
> Junior Developer
> 
> 

Re: Folder creation using Path in MR java code

Posted by Ted Yu <yu...@gmail.com>.
Take a look at this API (and its variants):
http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#create(org.apache.hadoop.fs.Path,%20boolean)

On Nov 30, 2013, at 12:54 AM, unmesha sreeveni <un...@gmail.com> wrote:

> Hi all
>          How to create a folder in hdfs using java code
> 
> I tried
> 
> Path folder = new Path("dir1");
> 
> But it is not created in hdfs. And i also tried it in eclipse. There also the folder is not creating.
>  
> 
> -- 
> Thanks & Regards
> 
> Unmesha Sreeveni U.B
> Junior Developer
> 
> 

Re: Folder creation using Path in MR java code

Posted by Ted Yu <yu...@gmail.com>.
Take a look at this API (and its variants):
http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#create(org.apache.hadoop.fs.Path,%20boolean)

On Nov 30, 2013, at 12:54 AM, unmesha sreeveni <un...@gmail.com> wrote:

> Hi all
>          How to create a folder in hdfs using java code
> 
> I tried
> 
> Path folder = new Path("dir1");
> 
> But it is not created in hdfs. And i also tried it in eclipse. There also the folder is not creating.
>  
> 
> -- 
> Thanks & Regards
> 
> Unmesha Sreeveni U.B
> Junior Developer
> 
> 

Re: Folder creation using Path in MR java code

Posted by Ted Yu <yu...@gmail.com>.
Take a look at this API (and its variants):
http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#create(org.apache.hadoop.fs.Path,%20boolean)

On Nov 30, 2013, at 12:54 AM, unmesha sreeveni <un...@gmail.com> wrote:

> Hi all
>          How to create a folder in hdfs using java code
> 
> I tried
> 
> Path folder = new Path("dir1");
> 
> But it is not created in hdfs. And i also tried it in eclipse. There also the folder is not creating.
>  
> 
> -- 
> Thanks & Regards
> 
> Unmesha Sreeveni U.B
> Junior Developer
> 
>