/** * Return a set of server default configuration values based on path. * @param f path to fetch server defaults * @return server default configuration values for path * @throws IOException an I/O error occurred */ public FsServerDefaults getServerDefaults(final Path f) throws IOException { return getServerDefaults(); }
@Override public FsServerDefaults getServerDefaults(final Path f) throws IOException { return myFs.getServerDefaults(f); }
@Override @Deprecated public FsServerDefaults getServerDefaults() throws IOException { return myFs.getServerDefaults(); }
@Override @Deprecated public FsServerDefaults getServerDefaults() throws IOException { return myFs.getServerDefaults(); }
@Override public FsServerDefaults getServerDefaults(final Path f) throws IOException { return myFs.getServerDefaults(fullPath(f)); }
private int getSumBufferSize(int bytesPerSum, int bufferSize, Path file) throws IOException { int defaultBufferSize = getMyFs().getServerDefaults(file) .getFileBufferSize(); int proportionalBufferSize = bufferSize / bytesPerSum; return Math.max(bytesPerSum, Math.max(proportionalBufferSize, defaultBufferSize)); }
public ChecksumFs(AbstractFileSystem theFs) throws IOException, URISyntaxException { super(theFs); defaultBytesPerChecksum = getMyFs().getServerDefaults(new Path("/")).getBytesPerChecksum(); }
/** * The specification of this method matches that of * {@link FileContext#open(Path, int)} except that Path f must be for this * file system. */ public abstract FSDataInputStream open(final Path f, int bufferSize) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException;
/** * Construct from a {@link FileContext}. * * @param fc FileContext * @param p path. * @throws IOException */ FSDataOutputStreamBuilder(@Nonnull FileContext fc, @Nonnull Path p) throws IOException { Preconditions.checkNotNull(fc); Preconditions.checkNotNull(p); this.fs = null; this.path = p; AbstractFileSystem afs = fc.getFSofPath(p); FsServerDefaults defaults = afs.getServerDefaults(p); bufferSize = defaults.getFileBufferSize(); replication = defaults.getReplication(); blockSize = defaults.getBlockSize(); }
@Override public FsServerDefaults getServerDefaults(final Path f) throws IOException { InodeTree.ResolveResult<AbstractFileSystem> res; try { res = fsState.resolve(getUriPath(f), true); } catch (FileNotFoundException fnfe) { return LocalConfigKeys.getServerDefaults(); } return res.targetFileSystem.getServerDefaults(res.remainingPath); }
FsServerDefaults ssDef = getServerDefaults(f); if (ssDef.getBlockSize() % ssDef.getBytesPerChecksum() != 0) { throw new IOException("Internal error: default blockSize is" +
createBufSize = fs.getServerDefaults().getFileBufferSize(); appendBufSize = fs.getServerDefaults().getFileBufferSize();
/** * Return a set of server default configuration values based on path. * @param f path to fetch server defaults * @return server default configuration values for path * @throws IOException an I/O error occurred */ public FsServerDefaults getServerDefaults(final Path f) throws IOException { return getServerDefaults(); }
@Override @Deprecated public FsServerDefaults getServerDefaults() throws IOException { return myFs.getServerDefaults(); }
@Override @Deprecated public FsServerDefaults getServerDefaults() throws IOException { return myFs.getServerDefaults(); }
private int getSumBufferSize(int bytesPerSum, int bufferSize) throws IOException { int defaultBufferSize = getMyFs().getServerDefaults().getFileBufferSize(); int proportionalBufferSize = bufferSize / bytesPerSum; return Math.max(bytesPerSum, Math.max(proportionalBufferSize, defaultBufferSize)); }
public ChecksumFs(AbstractFileSystem theFs) throws IOException, URISyntaxException { super(theFs); defaultBytesPerChecksum = getMyFs().getServerDefaults(new Path("/")).getBytesPerChecksum(); }
public ChecksumFs(AbstractFileSystem theFs) throws IOException, URISyntaxException { super(theFs); defaultBytesPerChecksum = getMyFs().getServerDefaults(new Path("/")).getBytesPerChecksum(); }
/** * The specification of this method matches that of * {@link FileContext#open(Path, int)} except that Path f must be for this * file system. */ public abstract FSDataInputStream open(final Path f, int bufferSize) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException;
@Override public FsServerDefaults getServerDefaults(final Path f) throws IOException { InodeTree.ResolveResult<AbstractFileSystem> res; try { res = fsState.resolve(getUriPath(f), true); } catch (FileNotFoundException fnfe) { return LocalConfigKeys.getServerDefaults(); } return res.targetFileSystem.getServerDefaults(res.remainingPath); }