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 <[email protected]>
> 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 [[email protected]]
> *Sent:* Wednesday, October 09, 2013 10:20 AM
> *To:* [email protected]
> *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
> [email protected]
>
>
--
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
[email protected]