use of org.apache.hadoop.hbase.shaded.protobuf.generated.RegistryProtos.GetMetaRegionLocationsResponse in project hbase by apache.
the class TestClientMetaServiceRPCs method TestMetaLocations.
/**
* Verifies that the meta region locations RPC returns consistent results across all masters.
*/
@Test
public void TestMetaLocations() throws Exception {
HBaseRpcController rpcController = getRpcController();
List<HRegionLocation> metaLocations = TEST_UTIL.getMiniHBaseCluster().getMaster().getMetaLocations();
Collections.sort(metaLocations);
int rpcCount = 0;
for (JVMClusterUtil.MasterThread masterThread : TEST_UTIL.getMiniHBaseCluster().getMasterThreads()) {
ClientMetaService.BlockingInterface stub = getMasterStub(masterThread.getMaster().getServerName());
GetMetaRegionLocationsResponse resp = stub.getMetaRegionLocations(rpcController, GetMetaRegionLocationsRequest.getDefaultInstance());
List<HRegionLocation> result = new ArrayList<>();
resp.getMetaLocationsList().forEach(location -> result.add(ProtobufUtil.toRegionLocation(location)));
Collections.sort(result);
assertEquals(metaLocations, result);
rpcCount++;
}
assertEquals(MASTER_COUNT, rpcCount);
}
Aggregations