Toggle navigation
Home
java.util.List<java.nio.ByteBuffer> to alluxio.thrift.GetNextKeysTResponse
No. of Instances - 12
No. of Commits - 1
No. of Projects - {'alluxio'}
Hierarchy/Composition: Composition
Primitive Info: -
NameSpace: Jdk -> Internal
Mapping:
Cascading Type Change (Similar)
List<ByteBuffer>
to
GetNextKeysTResponse
RpcCallableThrowsIOException<List<ByteBuffer>>
to
RpcCallableThrowsIOException<GetNextKeysTResponse>
Update Anonymous class
{ @Override public List<ByteBuffer> call() throws AlluxioException, IOException { final long sessionId=Sessions.KEYVALUE_SESSION_ID; final long lockId=mBlockWorker.lockBlock(sessionId,blockId); try { ByteBufferKeyValuePartitionReader reader=getReader(sessionId,lockId,blockId); Index index=reader.getIndex(); PayloadReader payloadReader=reader.getPayloadReader(); List<ByteBuffer> ret=Lists.newArrayListWithExpectedSize(numKeys); ByteBuffer currentKey=key; for (int i=0; i < numKeys; i++) { ByteBuffer nextKey=index.nextKey(currentKey,payloadReader); if (nextKey == null) { break; } ret.add(copyAsNonDirectBuffer(nextKey)); currentKey=nextKey; } return ret; } catch ( InvalidWorkerStateException e) { LOG.error("Reaching invalid state to get all keys",e); } finally { mBlockWorker.unlockBlock(lockId); } return Collections.emptyList(); } }
to
{ @Override public GetNextKeysTResponse call() throws AlluxioException, IOException { final long sessionId=Sessions.KEYVALUE_SESSION_ID; final long lockId=mBlockWorker.lockBlock(sessionId,blockId); try { ByteBufferKeyValuePartitionReader reader=getReader(sessionId,lockId,blockId); Index index=reader.getIndex(); PayloadReader payloadReader=reader.getPayloadReader(); List<ByteBuffer> ret=Lists.newArrayListWithExpectedSize(numKeys); ByteBuffer currentKey=key; for (int i=0; i < numKeys; i++) { ByteBuffer nextKey=index.nextKey(currentKey,payloadReader); if (nextKey == null) { break; } ret.add(copyAsNonDirectBuffer(nextKey)); currentKey=nextKey; } return new GetNextKeysTResponse(ret); } catch ( InvalidWorkerStateException e) { LOG.error("Reaching invalid state to get all keys",e); } finally { mBlockWorker.unlockBlock(lockId); } return new GetNextKeysTResponse(); } }