/** Return the {@link QuotaUsage} of a given {@link Path}. * @param f path to use * @return the quota usage * @throws IOException IO failure */ public QuotaUsage getQuotaUsage(Path f) throws IOException { return getContentSummary(f); }
/** * @param location - path to a partition (or table if not partitioned) dir */ private static long getDataSize(Path location, Configuration conf) throws IOException { FileSystem fs = location.getFileSystem(conf); ContentSummary cs = fs.getContentSummary(location); return cs.getLength(); }
@Override public Long call() throws Exception { try { LOG.debug("Partition path : " + path); FileSystem fs = path.getFileSystem(conf); return fs.getContentSummary(path).getLength(); } catch (IOException e) { return 0L; } } }));
private long getFileSize(String hdfsUrl) throws IOException { Configuration configuration = new Configuration(); Path path = new Path(hdfsUrl); FileSystem fs = path.getFileSystem(configuration); ContentSummary contentSummary = fs.getContentSummary(path); long length = contentSummary.getLength(); return length; }
/** * @param location - path to a partition (or table if not partitioned) dir */ private static long getDataSize(Path location, HiveConf conf) throws IOException { FileSystem fs = location.getFileSystem(conf); ContentSummary cs = fs.getContentSummary(location); return cs.getLength(); }
private long getFileSizeForPath(Path path) throws IOException { FileSystem fs = path.getFileSystem(conf); return fs.getContentSummary(path).getLength(); }
@Override public ContentSummary call() throws Exception { return fs.getContentSummary(path); } }, FileNotFoundException.class, null);
@Override public ContentSummary call() throws Exception { return fs.getContentSummary(path); } }, FileNotFoundException.class, null);
private long getFileLength() throws IOException { if( fileLen==-1L ) { fileLen = fs.getContentSummary(file).getLength(); } return fileLen; }
/** * Return the total size of all files from a specified path. * @throws IOException IO failure */ public long getUsed(Path path) throws IOException { return getContentSummary(path).getLength(); }
@Override public Long call() throws Exception { try { LOG.debug("Partition path : " + path); FileSystem fs = path.getFileSystem(conf); return fs.getContentSummary(path).getLength(); } catch (IOException e) { return 0L; } } }));
private long getSpace(FileStatus f) { Long cached = directorySpaces.get(f); if (cached != null) { return cached; } try { long space = f.isDirectory() ? fs.getContentSummary(f.getPath()).getSpaceConsumed() : f.getLen(); directorySpaces.put(f, space); return space; } catch (IOException e) { LOG.trace("Failed to get space consumed by path={}", f, e); return -1; } } });
private long getFileSize(Path currentPath) throws IOException { long fileSize; try { fileSize = fs.getContentSummary(currentPath).getLength(); } catch (FileNotFoundException e) { currentPath = getArchivedLogPath(currentPath, conf); fileSize = fs.getContentSummary(currentPath).getLength(); } return fileSize; }
private void calculateEntrySize(CacheEntry entry, FetchWork fetchWork) throws IOException { Path queryResultsPath = fetchWork.getTblDir(); FileSystem resultsFs = queryResultsPath.getFileSystem(conf); ContentSummary cs = resultsFs.getContentSummary(queryResultsPath); entry.size = cs.getLength(); }
private long getInputSize() throws IOException { long inputSize = 0; for (Path inputPath : this.getInputPaths()) { inputSize += this.fs.getContentSummary(inputPath).getLength(); } return inputSize; }
@Override public ContentSummary getContentSummary(Path f) throws IOException { InodeTree.ResolveResult<FileSystem> res = fsState.resolve(getUriPath(f), true); return res.targetFileSystem.getContentSummary(res.remainingPath); }
/** {@inheritDoc} */ @Override public long usedSpaceSize() { try { // We don't use FileSystem#getUsed() since it counts only the files // in the filesystem root, not all the files recursively. return fileSystemForUser().getContentSummary(new Path("/")).getSpaceConsumed(); } catch (IOException e) { throw handleSecondaryFsError(e, "Failed to get used space size of file system."); } }
public boolean isEmpty(Path path) throws IOException, MetaException { ContentSummary contents = getFs(path).getContentSummary(path); if (contents != null && contents.getFileCount() == 0 && contents.getDirectoryCount() == 1) { return true; } return false; }
@Override public Model load(Path f) throws IOException { FSDataInputStream is = _hfs.open(f); byte buf[] = MemoryManager.malloc1((int) _hfs.getContentSummary(f).getLength()); try { is.readFully(buf); } finally { is.close(); } AutoBuffer ab=ab4read(buf); Model m = loadHeader(ab); m.getModelSerializer().load(m, ab); if (m._key!=null) { DKV.put(m._key, m); } return m; }
@Override protected void processPath(PathData item) throws IOException { ContentSummary contentSummary = item.fs.getContentSummary(item.path); long length = contentSummary.getLength(); long spaceConsumed = contentSummary.getSpaceConsumed(); if (excludeSnapshots) { length -= contentSummary.getSnapshotLength(); spaceConsumed -= contentSummary.getSnapshotSpaceConsumed(); } getUsagesTable().addRow(formatSize(length), formatSize(spaceConsumed), item); } }