long offset() { return new OffsetParam(param(OffsetParam.NAME)).getOffset(); }
ResponseBuilder rb = Response.noContent(); final URI uri = redirectURI(rb, namenode, ugi, delegation, username, doAsUser, fullpath, op.getValue(), offset.getValue(), -1L, excludeDatanodes.getValue(), offset, length, bufferSize); if(!noredirectParam.getValue()) { final long offsetValue = offset.getValue(); final Long lengthValue = length.getValue(); LocatedBlocks locatedBlocks = getRpcClientProtocol() final long offsetValue = offset.getValue(); final Long lengthValue = length.getValue(); final LocatedBlocks locatedblocks = cp.getBlockLocations(fullpath,
@Test public void testOffset() throws IOException { final long X = 42; long offset = new OffsetParam(Long.toString(X)).getOffset(); Assert.assertEquals("OffsetParam: ", X, offset); offset = new OffsetParam((String) null).getOffset(); Assert.assertEquals("OffsetParam with null should have defaulted to 0", 0, offset); try { offset = new OffsetParam("abc").getValue(); Assert.fail("OffsetParam with nondigit value should have thrown IllegalArgumentException"); } catch (IllegalArgumentException iae) { // Ignore } } }
/** Setup offset url and connect. */ @Override protected HttpURLConnection connect(final long offset, final boolean resolved) throws IOException { final URL offsetUrl = offset == 0L? url : new URL(url + "&" + new OffsetParam(offset)); return new URLRunner(GetOpParam.Op.OPEN, offsetUrl, resolved).run(); } }
/** Setup offset url and connect. */ @Override protected HttpURLConnection connect(final long offset, final boolean resolved) throws IOException { final URL offsetUrl = offset == 0L? url : new URL(url + "&" + new OffsetParam(offset)); return new URLRunner(GetOpParam.Op.OPEN, offsetUrl, resolved, true).run(); } }
/** Setup offset url and connect. */ @Override protected HttpURLConnection connect(final long offset, final boolean resolved) throws IOException { final URL offsetUrl = offset == 0L? url : new URL(url + "&" + new OffsetParam(offset)); return new URLRunner(GetOpParam.Op.OPEN, offsetUrl, resolved).run(); } }
long offset() { return new OffsetParam(param(OffsetParam.NAME)).getOffset(); }
public Long getOffset() { Long offset = getValue(); return (offset == null) ? Long.valueOf(0) : offset; } }
@Override public BlockLocation[] getFileBlockLocations(final Path p, final long offset, final long length) throws IOException { statistics.incrementReadOps(1); final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS; return new FsPathResponseRunner<BlockLocation[]>(op, p, new OffsetParam(offset), new LengthParam(length)) { @Override BlockLocation[] decodeResponse(Map<?,?> json) throws IOException { return DFSUtil.locatedBlocks2Locations( JsonUtil.toLocatedBlocks(json)); } }.run(); }
long offset() { return new OffsetParam(param(OffsetParam.NAME)).getOffset(); }
public Long getOffset() { Long offset = getValue(); return (offset == null) ? Long.valueOf(0) : offset; } }
@Override public BlockLocation[] getFileBlockLocations(final Path p, final long offset, final long length) throws IOException { statistics.incrementReadOps(1); final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS; return new FsPathResponseRunner<BlockLocation[]>(op, p, new OffsetParam(offset), new LengthParam(length)) { @Override BlockLocation[] decodeResponse(Map<?,?> json) throws IOException { return DFSUtil.locatedBlocks2Locations( JsonUtil.toLocatedBlocks(json)); } }.run(); }
public Long getOffset() { Long offset = getValue(); return (offset == null) ? Long.valueOf(0) : offset; } }
@Override public BlockLocation[] getFileBlockLocations(final Path p, final long offset, final long length) throws IOException { statistics.incrementReadOps(1); storageStatistics.incrementOpCounter(OpType.GET_FILE_BLOCK_LOCATIONS); final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS; return new FsPathResponseRunner<BlockLocation[]>(op, p, new OffsetParam(offset), new LengthParam(length)) { @Override BlockLocation[] decodeResponse(Map<?,?> json) throws IOException { return DFSUtilClient.locatedBlocks2Locations( JsonUtilClient.toLocatedBlocks(json)); } }.run(); }
doAsUser, fullpath, op.getValue(), offset.getValue(), -1L, excludeDatanodes.getValue(), offset, length, bufferSize); return Response.temporaryRedirect(uri).type(MediaType.APPLICATION_OCTET_STREAM).build(); final long offsetValue = offset.getValue(); final Long lengthValue = length.getValue(); final LocatedBlocks locatedblocks = np.getBlockLocations(fullpath,
@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; }
doAsUser, fullpath, op.getValue(), offset.getValue(), -1L, excludeDatanodes.getValue(), offset, length, bufferSize); return Response.temporaryRedirect(uri).type(MediaType.APPLICATION_OCTET_STREAM).build(); final long offsetValue = offset.getValue(); final Long lengthValue = length.getValue(); final LocatedBlocks locatedblocks = np.getBlockLocations(fullpath,
@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; }
final URL rurl = new URL(resolvedUrl + "&" + new OffsetParam(pos)); cachedConnection = new URLRunner(GetOpParam.Op.OPEN, rurl, true).run(); } catch (IOException ioe) {