Search in sources :

Example 16 with RPCResponse

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

the class NettyDataServerTest method blockWorkerExceptionCausesReadFailedStatus.

@Test
public void blockWorkerExceptionCausesReadFailedStatus() throws Exception {
    when(mBlockWorker.readBlockRemote(anyLong(), anyLong(), anyLong())).thenThrow(new RuntimeException());
    RPCResponse response = request(new RPCBlockReadRequest(1, 2, 3, 4, 0));
    // Verify that the read request failed with UFS_READ_FAILED status.
    assertEquals(RPCResponse.Status.UFS_READ_FAILED, response.getStatus());
}
Also used : RPCBlockReadRequest(alluxio.network.protocol.RPCBlockReadRequest) RPCResponse(alluxio.network.protocol.RPCResponse) Test(org.junit.Test)

Aggregations

RPCResponse (alluxio.network.protocol.RPCResponse)16 Test (org.junit.Test)12 DataByteArrayChannel (alluxio.network.protocol.databuffer.DataByteArrayChannel)7 RPCBlockReadRequest (alluxio.network.protocol.RPCBlockReadRequest)5 RPCBlockWriteRequest (alluxio.network.protocol.RPCBlockWriteRequest)4 RPCErrorResponse (alluxio.network.protocol.RPCErrorResponse)4 Channel (io.netty.channel.Channel)4 ChannelFuture (io.netty.channel.ChannelFuture)4 IOException (java.io.IOException)4 RPCBlockReadResponse (alluxio.network.protocol.RPCBlockReadResponse)3 RPCFileWriteRequest (alluxio.network.protocol.RPCFileWriteRequest)3 RPCFileReadRequest (alluxio.network.protocol.RPCFileReadRequest)2 MockBlockWriter (alluxio.worker.block.io.MockBlockWriter)2 BlockDoesNotExistException (alluxio.exception.BlockDoesNotExistException)1 RPCBlockWriteResponse (alluxio.network.protocol.RPCBlockWriteResponse)1 RPCFileWriteResponse (alluxio.network.protocol.RPCFileWriteResponse)1 RPCUnderFileSystemBlockReadRequest (alluxio.network.protocol.RPCUnderFileSystemBlockReadRequest)1 DataBuffer (alluxio.network.protocol.databuffer.DataBuffer)1 MockBlockReader (alluxio.worker.block.io.MockBlockReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1