Search in sources :

Example 6 with RPCBlockReadRequest

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

the class NettyDataServerTest method blockWorkerExceptionCausesFailStatusOnRead.

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

Example 7 with RPCBlockReadRequest

use of alluxio.network.protocol.RPCBlockReadRequest 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

RPCBlockReadRequest (alluxio.network.protocol.RPCBlockReadRequest)7 RPCResponse (alluxio.network.protocol.RPCResponse)5 Test (org.junit.Test)5 RPCErrorResponse (alluxio.network.protocol.RPCErrorResponse)2 IOException (java.io.IOException)2 BlockDoesNotExistException (alluxio.exception.BlockDoesNotExistException)1 RPCBlockReadResponse (alluxio.network.protocol.RPCBlockReadResponse)1 RPCBlockWriteRequest (alluxio.network.protocol.RPCBlockWriteRequest)1 RPCFileReadRequest (alluxio.network.protocol.RPCFileReadRequest)1 RPCFileWriteRequest (alluxio.network.protocol.RPCFileWriteRequest)1 RPCMessage (alluxio.network.protocol.RPCMessage)1 RPCProtoMessage (alluxio.network.protocol.RPCProtoMessage)1 RPCUnderFileSystemBlockReadRequest (alluxio.network.protocol.RPCUnderFileSystemBlockReadRequest)1 MockBlockReader (alluxio.worker.block.io.MockBlockReader)1 Channel (io.netty.channel.Channel)1 ChannelFuture (io.netty.channel.ChannelFuture)1