int bufferSize() { return new BufferSizeParam(param(BufferSizeParam.NAME)).getValue(conf); }
ReadRunner(Path p, int bs) throws IOException { super(GetOpParam.Op.OPEN, p, new BufferSizeParam(bs)); this.path = p; this.bufferSize = bs; }
ReadRunner(Path p, int bs) throws IOException { super(GetOpParam.Op.OPEN, p, new BufferSizeParam(bs)); this.path = p; this.bufferSize = bs; }
int bufferSize() { return new BufferSizeParam(param(BufferSizeParam.NAME)).getValue(conf); }
@Override protected URL getUrl() throws IOException { return toUrl(op, path, new BufferSizeParam(bufferSize)); } };
int bufferSize() { return new BufferSizeParam(param(BufferSizeParam.NAME)).getValue(conf); }
ReadRunner(Path p, int bs) throws IOException { super(GetOpParam.Op.OPEN, p, new BufferSizeParam(bs)); this.path = p; this.bufferSize = bs; getRedirectedUrl(); }
@Test public void testBufferSizeParam() { final BufferSizeParam p = new BufferSizeParam(BufferSizeParam.DEFAULT); Assert.assertEquals(null, p.getValue()); Assert.assertEquals( conf.getInt(CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY, CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_DEFAULT), p.getValue(conf)); new BufferSizeParam(1); try { new BufferSizeParam(0); Assert.fail(); } catch(IllegalArgumentException e) { LOG.info("EXPECTED: " + e); } }
@Override public FSDataOutputStream append(final Path f, final int bufferSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PostOpParam.Op.APPEND; return new FsPathOutputStreamRunner(op, f, bufferSize, new BufferSizeParam(bufferSize) ).run(); }
@Override public FSDataOutputStream append(final Path f, final int bufferSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PostOpParam.Op.APPEND; return new FsPathOutputStreamRunner(op, f, bufferSize, new BufferSizeParam(bufferSize) ).run(); }
@Override public FSDataOutputStream append(final Path f, final int bufferSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); storageStatistics.incrementOpCounter(OpType.APPEND); final HttpOpParam.Op op = PostOpParam.Op.APPEND; return new FsPathOutputStreamRunner(op, f, bufferSize, new BufferSizeParam(bufferSize) ).run(); }
@Override protected URL getUrl() throws IOException { // This method is called every time either a read is executed. // The check for connection == null is to ensure that a new URL is only // created upon a new connection and not for every read. if (cachedConnection == null) { // Update URL with current offset. BufferSize doesn't change, but it // still must be included when creating the new URL. updateURLParameters(new BufferSizeParam(bufferSize), new OffsetParam(pos)); originalUrl = super.getUrl(); } return originalUrl; }
@Override protected URL getUrl() throws IOException { // This method is called every time either a read is executed. // The check for connection == null is to ensure that a new URL is only // created upon a new connection and not for every read. if (cachedConnection == null) { // Update URL with current offset. BufferSize doesn't change, but it // still must be included when creating the new URL. updateURLParameters(new BufferSizeParam(bufferSize), new OffsetParam(pos)); originalUrl = super.getUrl(); } return originalUrl; }
@Override protected URL getUrl() throws IOException { // This method is called every time either a read is executed. // The check for connection == null is to ensure that a new URL is only // created upon a new connection and not for every read. if (cachedConnection == null) { // Update URL with current offset. BufferSize doesn't change, but it // still must be included when creating the new URL. updateURLParameters(new BufferSizeParam(bufferSize), new OffsetParam(pos)); originalUrl = super.getUrl(); } return originalUrl; }
@Override public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.CREATE; return new FsPathOutputStreamRunner(op, f, bufferSize, new PermissionParam(applyUMask(permission)), new OverwriteParam(overwrite), new BufferSizeParam(bufferSize), new ReplicationParam(replication), new BlockSizeParam(blockSize) ).run(); }
@Override public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); final HttpOpParam.Op op = PutOpParam.Op.CREATE; return new FsPathOutputStreamRunner(op, f, bufferSize, new PermissionParam(applyUMask(permission)), new OverwriteParam(overwrite), new BufferSizeParam(bufferSize), new ReplicationParam(replication), new BlockSizeParam(blockSize) ).run(); }
@Override public FSDataOutputStream create(final Path f, final FsPermission permission, final boolean overwrite, final int bufferSize, final short replication, final long blockSize, final Progressable progress) throws IOException { statistics.incrementWriteOps(1); storageStatistics.incrementOpCounter(OpType.CREATE); final FsPermission modes = applyUMask(permission); final HttpOpParam.Op op = PutOpParam.Op.CREATE; return new FsPathOutputStreamRunner(op, f, bufferSize, new PermissionParam(modes.getMasked()), new UnmaskedPermissionParam(modes.getUnmasked()), new OverwriteParam(overwrite), new BufferSizeParam(bufferSize), new ReplicationParam(replication), new BlockSizeParam(blockSize) ).run(); }