use of alluxio.client.keyvalue.ByteBufferKeyValuePartitionReader in project alluxio by Alluxio.
the class KeyValueWorkerClientServiceHandler method getReader.
private ByteBufferKeyValuePartitionReader getReader(long sessionId, long lockId, long blockId) throws InvalidWorkerStateException, BlockDoesNotExistException, IOException {
BlockReader blockReader = mBlockWorker.readBlockRemote(sessionId, blockId, lockId);
ByteBuffer fileBuffer = blockReader.read(0, blockReader.getLength());
ByteBufferKeyValuePartitionReader reader = new ByteBufferKeyValuePartitionReader(fileBuffer);
// TODO(binfan): clean fileBuffer which is a direct byte buffer
blockReader.close();
return reader;
}
Aggregations