Search in sources :

Example 1 with ByteBufferKeyValuePartitionReader

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;
}
Also used : BlockReader(alluxio.worker.block.io.BlockReader) ByteBuffer(java.nio.ByteBuffer) ByteBufferKeyValuePartitionReader(alluxio.client.keyvalue.ByteBufferKeyValuePartitionReader)

Aggregations

ByteBufferKeyValuePartitionReader (alluxio.client.keyvalue.ByteBufferKeyValuePartitionReader)1 BlockReader (alluxio.worker.block.io.BlockReader)1 ByteBuffer (java.nio.ByteBuffer)1