/** * Create a client instancclientAppPathExiste * @param hosts host strings: zk01:2181,zk02:2181,zk03:2181 * @param namespace path root, such as app name */ public static ZkClient newClient(String hosts, String namespace){ return newClient(hosts, namespace, DEFAULT_RETRY_STRATEGY); }
AntaresZkAgent(AbstractAntaresClient client, String zkServers, String namespace){ this.client = client; this.zk = ZkClient.newClient(zkServers, namespace); }
@Autowired public AntaresZkClient( @Value("${antares.zk.servers:127.0.0.1:2181}") String zkServers, @Value("${antares.zk.namespace:ats}") String zkNamespace){ this.zkServers = zkServers; this.client = ZkClient.newClient(zkServers, zkNamespace); }