hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kun yan <yankunhad...@gmail.com>
Subject Re: how to use ContentSumary
Date Wed, 09 Oct 2013 08:16:13 GMT
thanks a lot ,i can successful exec the follow code

        Configuration conf = new Configuration();
conf.set("fs.defaultFS", "192.1.1.1:8020");
FileSystem fs = FileSystem.get(conf);
ContentSummary cs = fs.getContentSummary(new Path("/sequence"));
System.out.println("cs is what ? " + cs.toString());
System.out.println("direcotry count is :" + cs.getDirectoryCount());
System.out.println("file count is :" + cs.getFileCount());


2013/10/9 Brahma Reddy Battula <brahmareddy.battula@huawei.com>

>  Please check the following for same....
>
>
>
> DistributedFileSystem dfs=
> *new* DistributedFileSystem ();
>
> dfs.initialize(URI.*create*("hdfs://hacluster"), conf);
>
> DistributedFileSystem
> dfs = *new* DistributedFileSystem();
>
> cnSum=dfs.getContentSummary(new Path(dirName));
> cnSum.getQuota()
> cnSum.getSpaceQuota()
> cnSum.getSpaceConsumed()
>
> ...
>
> ...
>
> ...
>
>
>
>
>
>
>
>
>
> Note : you need to pass the conf correctly..
>  ------------------------------
> *From:* kun yan [yankunhadoop@gmail.com]
> *Sent:* Wednesday, October 09, 2013 10:20 AM
> *To:* user@hadoop.apache.org
> *Subject:* how to use ContentSumary
>
>   hi all
> In *org.apache.hadoop.fs *
> *i found ContentSumary  but i am not sure how to use it.Who can help me
> ,thanks a lot
> *
>
>
>  --
>
> In the Hadoop world, I am just a novice, explore the entire Hadoop
> ecosystem, I hope one day I can contribute their own code
>
> YanBit
> yankunhadoop@gmail.com
>
>


-- 

In the Hadoop world, I am just a novice, explore the entire Hadoop
ecosystem, I hope one day I can contribute their own code

YanBit
yankunhadoop@gmail.com

Mime
View raw message