Java Code Examples for org.apache.hadoop.hbase.zookeeper.ZKConfig#getZooKeeperClusterKey()

The following examples show how to use org.apache.hadoop.hbase.zookeeper.ZKConfig#getZooKeeperClusterKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestReplicationStateZKImpl.java    From hbase with Apache License 2.0 5 votes vote down vote up
private static String initPeerClusterState(String baseZKNode)
    throws IOException, KeeperException {
  // Add a dummy region server and set up the cluster id
  Configuration testConf = new Configuration(conf);
  testConf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, baseZKNode);
  ZKWatcher zkw1 = new ZKWatcher(testConf, "test1", null);
  String fakeRs = ZNodePaths.joinZNode(zkw1.getZNodePaths().rsZNode,
          "hostname1.example.org:1234");
  ZKUtil.createWithParents(zkw1, fakeRs);
  ZKClusterId.setClusterId(zkw1, new ClusterId());
  return ZKConfig.getZooKeeperClusterKey(testConf);
}
 
Example 2
Source File: TestReplicationStateZKImpl.java    From hbase with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
  zkTimeoutCount = 0;
  rqs = ReplicationStorageFactory.getReplicationQueueStorage(zkw, conf);
  rp = ReplicationFactory.getReplicationPeers(zkw, conf);
  OUR_KEY = ZKConfig.getZooKeeperClusterKey(conf);
}