Search in sources :

Example 6 with RPCBlockReadResponse

use of alluxio.network.protocol.RPCBlockReadResponse in project alluxio by Alluxio.

the class NettyRemoteBlockReaderTest method createRPCBlockReadResponse.

private RPCBlockReadResponse createRPCBlockReadResponse(RPCResponse.Status status) {
    ByteBuffer byteBuffer = ByteBuffer.allocateDirect((int) LENGTH);
    byteBuffer.put("alluxio".getBytes());
    DataBuffer dataBuffer = new DataByteBuffer(byteBuffer, LENGTH);
    return new RPCBlockReadResponse(BLOCK_ID, OFFSET, LENGTH, dataBuffer, status);
}
Also used : DataByteBuffer(alluxio.network.protocol.databuffer.DataByteBuffer) RPCBlockReadResponse(alluxio.network.protocol.RPCBlockReadResponse) ByteBuffer(java.nio.ByteBuffer) DataByteBuffer(alluxio.network.protocol.databuffer.DataByteBuffer) DataBuffer(alluxio.network.protocol.databuffer.DataBuffer)

Aggregations

RPCBlockReadResponse (alluxio.network.protocol.RPCBlockReadResponse)6 DataBuffer (alluxio.network.protocol.databuffer.DataBuffer)4 ChannelFuture (io.netty.channel.ChannelFuture)4 IOException (java.io.IOException)4 RPCResponse (alluxio.network.protocol.RPCResponse)3 BlockDoesNotExistException (alluxio.exception.BlockDoesNotExistException)2 RPCErrorResponse (alluxio.network.protocol.RPCErrorResponse)2 DataByteBuffer (alluxio.network.protocol.databuffer.DataByteBuffer)2 BlockReader (alluxio.worker.block.io.BlockReader)2 Channel (io.netty.channel.Channel)2 ByteBuffer (java.nio.ByteBuffer)2 RPCBlockReadRequest (alluxio.network.protocol.RPCBlockReadRequest)1 RPCUnderFileSystemBlockReadRequest (alluxio.network.protocol.RPCUnderFileSystemBlockReadRequest)1 Test (org.junit.Test)1