Search in sources :

Example 1 with GetActiveMasterResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetActiveMasterResponse in project hbase by apache.

the class TestClientMetaServiceRPCs method TestActiveMaster.

/**
 * Verifies the active master ServerName as seen by all masters.
 */
@Test
public void TestActiveMaster() throws Exception {
    HBaseRpcController rpcController = getRpcController();
    ServerName activeMaster = TEST_UTIL.getMiniHBaseCluster().getMaster().getServerName();
    int rpcCount = 0;
    for (JVMClusterUtil.MasterThread masterThread : TEST_UTIL.getMiniHBaseCluster().getMasterThreads()) {
        ClientMetaService.BlockingInterface stub = getMasterStub(masterThread.getMaster().getServerName());
        GetActiveMasterResponse resp = stub.getActiveMaster(rpcController, GetActiveMasterRequest.getDefaultInstance());
        assertEquals(activeMaster, ProtobufUtil.toServerName(resp.getServerName()));
        rpcCount++;
    }
    assertEquals(MASTER_COUNT, rpcCount);
}
Also used : HBaseRpcController(org.apache.hadoop.hbase.ipc.HBaseRpcController) JVMClusterUtil(org.apache.hadoop.hbase.util.JVMClusterUtil) ServerName(org.apache.hadoop.hbase.ServerName) ClientMetaService(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.ClientMetaService) GetActiveMasterResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetActiveMasterResponse) Test(org.junit.Test)

Aggregations

ServerName (org.apache.hadoop.hbase.ServerName)1 HBaseRpcController (org.apache.hadoop.hbase.ipc.HBaseRpcController)1 ClientMetaService (org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.ClientMetaService)1 GetActiveMasterResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetActiveMasterResponse)1 JVMClusterUtil (org.apache.hadoop.hbase.util.JVMClusterUtil)1 Test (org.junit.Test)1