MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / handleMetaZnodeIsRoot

Method handleMetaZnodeIsRoot

test/TestZKClient.java:1090–1110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1088 }
1089
1090 @Test
1091 public void handleMetaZnodeIsRoot() throws Exception {
1092 final ZKCallback cb = zk_client.new ZKCallback();
1093
1094 final ServerName server = ServerName.newBuilder()
1095 .setHostName("127.0.0.1").setPort(50511).build();
1096 final MetaRegionServer meta_server = MetaRegionServer.newBuilder()
1097 .setServer(server).build();
1098 final byte[] data = new byte[meta_server.getSerializedSize() + 10];
1099 data[0] = ZKCallback.MAGIC;
1100 Bytes.setInt(data, 1, 1);
1101 Bytes.setInt(data, HBaseClient.PBUF_MAGIC, 6);
1102 System.arraycopy(meta_server.toByteArray(), 0, data, 10,
1103 meta_server.getSerializedSize());
1104
1105 final RegionClient rc = cb.handleMetaZnode(data);
1106 assertNotNull(rc);
1107 assertEquals("127.0.0.1:50511", rc.getRemoteAddress());
1108 verifyPrivate(client).invoke("newClient", "127.0.0.1", 50511);
1109 assertFalse((Boolean)Whitebox.getInternalState(client, "has_root"));
1110 }
1111
1112 @Test
1113 public void handleMetaZnodeNotMagic() throws Exception {

Callers

nothing calls this directly

Calls 3

setIntMethod · 0.95
handleMetaZnodeMethod · 0.95
getRemoteAddressMethod · 0.95

Tested by

no test coverage detected