use of com.ctrip.xpipe.zk.ZkClient in project x-pipe by ctripcorp.
the class AbstractMetaServerClusterTest method getCuratorFramework.
protected CuratorFramework getCuratorFramework(int zkPort) throws Exception {
ZkClient client = new DefaultZkClient();
client.setZkAddress(String.format("localhost:%d", zkPort));
LifecycleHelper.initializeIfPossible(client);
LifecycleHelper.startIfPossible(client);
return client.get();
}
use of com.ctrip.xpipe.zk.ZkClient in project x-pipe by ctripcorp.
the class MetaServerPrepareResourcesAndStart method setupResouces.
private ApplicationContext setupResouces(DcMeta dcMeta) throws Exception {
ApplicationContext applicationContext = SpringComponentLifecycleManager.getApplicationContext();
logger.info("[setupResouces][set zkConnectionString]");
ZkClient zkClient = applicationContext.getBean(ZkClient.class);
zkClient.setZkAddress(zkAddress);
logger.info("[setupResouces][start MetaServerLifecycleManager]");
SpringComponentLifecycleManager metaServerLifecycleManager = applicationContext.getBean(SpringComponentLifecycleManager.class);
metaServerLifecycleManager.startAll();
return applicationContext;
}
Aggregations