Search in sources :

Example 11 with HeartbeatResponse

use of org.apache.hadoop.hdfs.server.protocol.HeartbeatResponse in project hadoop by apache.

the class TestFsDatasetCache method setHeartbeatResponse.

private static void setHeartbeatResponse(DatanodeCommand[] cmds) throws IOException {
    NNHAStatusHeartbeat ha = new NNHAStatusHeartbeat(HAServiceState.ACTIVE, fsImage.getLastAppliedOrWrittenTxId());
    HeartbeatResponse response = new HeartbeatResponse(cmds, ha, null, ThreadLocalRandom.current().nextLong() | 1L);
    doReturn(response).when(spyNN).sendHeartbeat((DatanodeRegistration) any(), (StorageReport[]) any(), anyLong(), anyLong(), anyInt(), anyInt(), anyInt(), (VolumeFailureSummary) any(), anyBoolean(), any(SlowPeerReports.class));
}
Also used : HeartbeatResponse(org.apache.hadoop.hdfs.server.protocol.HeartbeatResponse) NNHAStatusHeartbeat(org.apache.hadoop.hdfs.server.protocol.NNHAStatusHeartbeat) StorageReport(org.apache.hadoop.hdfs.server.protocol.StorageReport) SlowPeerReports(org.apache.hadoop.hdfs.server.protocol.SlowPeerReports)

Aggregations

HeartbeatResponse (org.apache.hadoop.hdfs.server.protocol.HeartbeatResponse)11 SlowPeerReports (org.apache.hadoop.hdfs.server.protocol.SlowPeerReports)7 VolumeFailureSummary (org.apache.hadoop.hdfs.server.protocol.VolumeFailureSummary)7 DatanodeCommand (org.apache.hadoop.hdfs.server.protocol.DatanodeCommand)6 DatanodeRegistration (org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration)5 NNHAStatusHeartbeat (org.apache.hadoop.hdfs.server.protocol.NNHAStatusHeartbeat)5 IOException (java.io.IOException)4 InetSocketAddress (java.net.InetSocketAddress)3 DatanodeProtocolClientSideTranslatorPB (org.apache.hadoop.hdfs.protocolPB.DatanodeProtocolClientSideTranslatorPB)3 NamespaceInfo (org.apache.hadoop.hdfs.server.protocol.NamespaceInfo)3 StorageReport (org.apache.hadoop.hdfs.server.protocol.StorageReport)3 Test (org.junit.Test)3 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 ServiceException (com.google.protobuf.ServiceException)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 RollingUpgradeStatus (org.apache.hadoop.hdfs.protocol.RollingUpgradeStatus)2 HeartbeatResponseProto (org.apache.hadoop.hdfs.protocol.proto.DatanodeProtocolProtos.HeartbeatResponseProto)2 EOFException (java.io.EOFException)1