You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by Ajit Ratnaparkhi <aj...@gmail.com> on 2011/09/29 13:19:58 UTC

Get Replication level of a file in HDFS.

Hi,

Is there any way to get replication level of a file in HDFS?

thanks,
Ajit.

Re: *****SPAM*****Get Replication level of a file in HDFS.

Posted by Ajit Ratnaparkhi <aj...@gmail.com>.
Thanks!

On Thu, Sep 29, 2011 at 5:50 PM, Kamesh <ka...@imaginea.com> wrote:

> **
> On Thursday 29 September 2011 04:49 PM, Ajit Ratnaparkhi wrote:
>
> Hi,
>
>  Is there any way to get replication level of a file in HDFS?
>
>  thanks,
> Ajit.
>
> If you want this through program or just want to know.
>
> 1) If You  just want to know, you can do this through NN web UI or through
> CLI ( execute ls command on HDFS ) after ACLs it shows the replication
> factor of the file.
> 2) If you need this info through program use the following API.
>                      FileStatus.getReplication();
>
>
> --
> *Thanks&Regards,*
> *Bh.V.S.Kamesh*
>

Re: *****SPAM*****Get Replication level of a file in HDFS.

Posted by Kamesh <ka...@imaginea.com>.
On Thursday 29 September 2011 04:49 PM, Ajit Ratnaparkhi wrote:
> Hi,
>
> Is there any way to get replication level of a file in HDFS?
>
> thanks,
> Ajit.
If you want this through program or just want to know.

1) If You  just want to know, you can do this through NN web UI or 
through CLI ( execute ls command on HDFS ) after ACLs it shows the 
replication factor of the file.
2) If you need this info through program use the following API.
                      FileStatus.getReplication();


-- 
/Thanks&Regards,/
/Bh.V.S.Kamesh/

Re: Get Replication level of a file in HDFS.

Posted by be...@gmail.com.
Hey Ajith
      When you fire a hadoop fs -ls command on a dir you can see that on the listing the second column shows the replication factor. And there is a pretty good API provided by hadoop using which you can get almost any details from hdfs, you just need to write a java program.

Hope it helps

Regards
Bejoy K S

-----Original Message-----
From: Ajit Ratnaparkhi <aj...@gmail.com>
Date: Thu, 29 Sep 2011 16:49:58 
To: <hd...@hadoop.apache.org>
Reply-To: hdfs-user@hadoop.apache.org
Subject: Get Replication level of a file in HDFS.

Hi,

Is there any way to get replication level of a file in HDFS?

thanks,
Ajit.


RE: Get Replication level of a file in HDFS.

Posted by Brahma Reddy <br...@huawei.com>.
Hi Ajit,

 

 

You can get the replication of a file using two ways like following

 

i)through command line

 

./hadoop fsck /filename -files -blocks -racks

 

It'll give detailed info about the file

 

ii)filestatus object(java)

 

 

****************************************************************************
***********
This e-mail and attachments contain confidential information from HUAWEI,
which is intended only for the person or entity whose address is listed
above. Any use of the information contained herein in any way (including,
but not limited to, total or partial disclosure, reproduction, or
dissemination) by persons other than the intended recipient's) is
prohibited. If you receive this e-mail in error, please notify the sender by
phone or email immediately and delete it!

Hi,

 

Is there any way to get replication level of a file in HDFS?

 

thanks,

Ajit.