List of usage examples for org.apache.hadoop.fs ContentSummary ContentSummary
@Deprecated public ContentSummary(long length, long fileCount, long directoryCount)
From source file:com.quantcast.qfs.hadoop.QuantcastFileSystem.java
License:Apache License
public ContentSummary getContentSummary(Path path) throws IOException { // since QFS stores sizes at each level of the dir tree, we can // just stat the dir. final Path absolute = makeAbsolute(path); final KfsFileAttr stat = qfsImpl.fullStat(absolute); if (stat.isDirectory) { final long len = stat.filesize; if (len < 0) { return getContentSummarySuper(absolute); }// ww w . j a v a 2 s . c om if (stat.dirCount < 0) { return new ContentSummaryProxy(absolute, len); } return new ContentSummary(len, stat.fileCount, stat.dirCount + 1); } return new ContentSummary(stat.filesize, 1, 0); }
From source file:com.splicemachine.storage.HNIOFileSystem.java
License:Apache License
@Override public FileInfo getInfo(String filePath) throws IOException { org.apache.hadoop.fs.Path f = new org.apache.hadoop.fs.Path(filePath); ContentSummary contentSummary;//from ww w . ja v a2 s.c om try { contentSummary = fs.getContentSummary(f); } catch (IOException ioe) { LOG.error( "Unexpected error getting content summary. We ignore it for now, but you should probably check it out:", ioe); contentSummary = new ContentSummary(0L, 0L, 0L); } return new HFileInfo(f, contentSummary); }