use of com.ctrip.xpipe.zk.impl.DefaultZkConfig in project x-pipe by ctripcorp.
the class Production method getZkClient.
@Override
protected ZkClient getZkClient(String zkNameSpace, String zkAddress) {
DefaultZkConfig zkConfig = new DefaultZkConfig();
zkConfig.setZkNameSpace(zkNameSpace);
SpringZkClient springZkClient = new SpringZkClient(zkConfig, zkAddress);
return springZkClient;
}
use of com.ctrip.xpipe.zk.impl.DefaultZkConfig in project x-pipe by ctripcorp.
the class TestMetaServer method doStart.
@Override
public void doStart() throws Exception {
System.setProperty(DefaultDcMetaCache.MEMORY_META_SERVER_DAO_KEY, configFile);
System.setProperty("TOTAL_SLOTS", String.valueOf(total_slots));
SpringApplication application = new SpringApplication(TestMetaServer.class);
application.setBannerMode(Mode.OFF);
application.setEnvironment(createEnvironment());
context = application.run(new String[] {});
TestZkClient client = context.getBean(TestZkClient.class);
DefaultZkConfig zkConfig = new DefaultZkConfig();
zkConfig.setZkSessionTimeoutMillis(zkSessionTimeoutMillis);
client.setZkConfig(zkConfig);
client.setZkAddress(zkConnectionStr);
UnitTestServerConfig config = context.getBean(UnitTestServerConfig.class);
config.setZkAddress(zkConnectionStr);
config.setMetaServerId(serverId);
config.setMetaServerPort(serverPort);
ArrangeTaskTrigger arrangeTaskTrigger = context.getBean(ArrangeTaskTrigger.class);
arrangeTaskTrigger.setWaitForRestartTimeMills(waitForRestartTimeMills);
manager = context.getBean(SpringComponentRegistry.class);
manager.initialize();
manager.start();
}
use of com.ctrip.xpipe.zk.impl.DefaultZkConfig in project x-pipe by ctripcorp.
the class TestPathChildren method beforeTestPathChildren.
@Before
public void beforeTestPathChildren() throws Exception {
DefaultZkConfig zkConfig = new DefaultZkConfig();
zkConfig.setZkConnectionTimeoutMillis(1000);
path = "/" + getTestName();
logger.info("[before create]");
client = zkConfig.create("10.2.38.87");
logger.info("[after create]");
if (client.checkExists().forPath(path) != null) {
client.delete().deletingChildrenIfNeeded().forPath(path);
}
}
use of com.ctrip.xpipe.zk.impl.DefaultZkConfig in project x-pipe by ctripcorp.
the class AbstractZkUsageTest method beforeAbstractZkUsageTest.
@Before
public void beforeAbstractZkUsageTest() throws InterruptedException {
ZkConfig zkConfig = new DefaultZkConfig();
client = zkConfig.create(zkAddress);
}
use of com.ctrip.xpipe.zk.impl.DefaultZkConfig in project x-pipe by ctripcorp.
the class DefaultLeaderElectorTest method beforeDefaultLeaderElectorTest.
@Before
public void beforeDefaultLeaderElectorTest() throws InterruptedException {
zkTestServer = startRandomZk();
ZkConfig config = new DefaultZkConfig();
client = config.create(String.format("localhost:%d", zkTestServer.getZkPort()));
}
Aggregations