/** * 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()); }
+ HConstants.ZOOKEEPER_ZNODE_PARENT); return new ZKClusterKey(parts [0], Integer.parseInt(parts [1]), parts [2]); return new ZKClusterKey(quorumStringInput, Integer.parseInt(clientPort), zNodeParent); return new ZKClusterKey( buildZKQuorumServerString(serverHosts, clientPort), Integer.parseInt(clientPort),
+ HConstants.ZOOKEEPER_ZNODE_PARENT); return new ZKClusterKey(parts [0], Integer.parseInt(parts [1]), parts [2]); return new ZKClusterKey(quorumStringInput, Integer.parseInt(clientPort), zNodeParent); return new ZKClusterKey( buildZKQuorumServerString(serverHosts, clientPort), Integer.parseInt(clientPort),
+ HConstants.ZOOKEEPER_ZNODE_PARENT); return new ZKClusterKey(parts [0], Integer.parseInt(parts [1]), parts [2]); return new ZKClusterKey(quorumStringInput, Integer.parseInt(clientPort), zNodeParent); return new ZKClusterKey( buildZKQuorumServerString(serverHosts, clientPort), Integer.parseInt(clientPort),
return new ZKClusterKey(parts [0], Integer.parseInt(parts [1]), parts [2]); return new ZKClusterKey(quorumStringInput, Integer.parseInt(clientPort), zNodeParent); return new ZKClusterKey( buildZKQuorumServerString(serverHosts, clientPort), Integer.parseInt(clientPort),
ensemble2 = ZKConfig.standardizeZKQuorumServerString(ensemble, Integer.toString(port)); assertEquals(ensemble2, zkClusterKey.getQuorumString()); assertEquals(ensemble, zkClusterKey.getQuorumString()); assertEquals(port, zkClusterKey.getClientPort()); assertEquals(znode, zkClusterKey.getZnodeParent()); assertEquals(zkClusterKey.getQuorumString(), conf.get(HConstants.ZOOKEEPER_QUORUM)); assertEquals(zkClusterKey.getClientPort(), conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, -1)); assertEquals(zkClusterKey.getZnodeParent(), conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));
ensemble2 = ZKConfig.standardizeZKQuorumServerString(ensemble, Integer.toString(port)); assertEquals(ensemble2, zkClusterKey.getQuorumString()); assertEquals(ensemble, zkClusterKey.getQuorumString()); assertEquals(port, zkClusterKey.getClientPort()); assertEquals(znode, zkClusterKey.getZnodeParent()); assertEquals(zkClusterKey.getQuorumString(), conf.get(HConstants.ZOOKEEPER_QUORUM)); 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()); }
/** * 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()); }
ensemble2 = ZKConfig.standardizeZKQuorumServerString(ensemble, Integer.toString(port)); assertEquals(ensemble2, zkClusterKey.getQuorumString()); assertEquals(ensemble, zkClusterKey.getQuorumString()); assertEquals(port, zkClusterKey.getClientPort()); assertEquals(znode, zkClusterKey.getZnodeParent()); assertEquals(zkClusterKey.getQuorumString(), conf.get(HConstants.ZOOKEEPER_QUORUM)); assertEquals(zkClusterKey.getClientPort(), conf.getInt(HConstants.ZOOKEEPER_CLIENT_PORT, -1)); assertEquals(zkClusterKey.getZnodeParent(), conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT));