/** * Apply the settings in the given key to the given configuration, this is * used to communicate with distant clusters * @param conf configuration object to configure * @param key string that contains the 3 required configuratins * @throws IOException */ private static void applyClusterKeyToConf(Configuration conf, String key) throws IOException{ ZKConfig.ZKClusterKey zkClusterKey = ZKConfig.transformClusterKey(key); conf.set(HConstants.ZOOKEEPER_QUORUM, zkClusterKey.getQuorumString()); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClusterKey.getClientPort()); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkClusterKey.getZnodeParent()); }
assertEquals(ensemble, zkClusterKey.getQuorumString()); assertEquals(port, zkClusterKey.getClientPort()); assertEquals(znode, zkClusterKey.getZnodeParent()); assertEquals(zkClusterKey.getClientPort(), conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, -1)); assertEquals(zkClusterKey.getZnodeParent(), conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
/** * Apply the settings in the given key to the given configuration, this is * used to communicate with distant clusters * @param conf configuration object to configure * @param key string that contains the 3 required configuratins * @throws IOException */ private static void applyClusterKeyToConf(Configuration conf, String key) throws IOException{ ZKConfig.ZKClusterKey zkClusterKey = ZKConfig.transformClusterKey(key); conf.set(HConstants.ZOOKEEPER_QUORUM, zkClusterKey.getQuorumString()); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClusterKey.getClientPort()); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkClusterKey.getZnodeParent()); }
assertEquals(ensemble, zkClusterKey.getQuorumString()); assertEquals(port, zkClusterKey.getClientPort()); assertEquals(znode, zkClusterKey.getZnodeParent()); assertEquals(zkClusterKey.getClientPort(), conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, -1)); assertEquals(zkClusterKey.getZnodeParent(), conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
assertEquals(ensemble, zkClusterKey.getQuorumString()); assertEquals(port, zkClusterKey.getClientPort()); assertEquals(znode, zkClusterKey.getZnodeParent()); assertEquals(zkClusterKey.getClientPort(), conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, -1)); assertEquals(zkClusterKey.getZnodeParent(), conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
/** * Apply the settings in the given key to the given configuration, this is * used to communicate with distant clusters * @param conf configuration object to configure * @param key string that contains the 3 required configuratins * @throws IOException */ private static void applyClusterKeyToConf(Configuration conf, String key) throws IOException{ ZKConfig.ZKClusterKey zkClusterKey = ZKConfig.transformClusterKey(key); conf.set(HConstants.ZOOKEEPER_QUORUM, zkClusterKey.getQuorumString()); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClusterKey.getClientPort()); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkClusterKey.getZnodeParent()); }
/** * Apply the settings in the given key to the given configuration, this is * used to communicate with distant clusters * @param conf configuration object to configure * @param key string that contains the 3 required configuratins * @throws IOException */ private static void applyClusterKeyToConf(Configuration conf, String key) throws IOException{ ZKConfig.ZKClusterKey zkClusterKey = ZKConfig.transformClusterKey(key); conf.set(HConstants.ZOOKEEPER_QUORUM, zkClusterKey.getQuorumString()); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClusterKey.getClientPort()); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkClusterKey.getZnodeParent()); }