Search in sources :

Example 1 with ArrangeTaskTrigger

use of com.ctrip.xpipe.redis.meta.server.cluster.impl.ArrangeTaskTrigger 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();
}
Also used : ArrangeTaskTrigger(com.ctrip.xpipe.redis.meta.server.cluster.impl.ArrangeTaskTrigger) SpringComponentRegistry(com.ctrip.xpipe.lifecycle.SpringComponentRegistry) SpringApplication(org.springframework.boot.SpringApplication) UnitTestServerConfig(com.ctrip.xpipe.redis.meta.server.config.UnitTestServerConfig) DefaultZkConfig(com.ctrip.xpipe.zk.impl.DefaultZkConfig) TestZkClient(com.ctrip.xpipe.zk.impl.TestZkClient)

Aggregations

SpringComponentRegistry (com.ctrip.xpipe.lifecycle.SpringComponentRegistry)1 ArrangeTaskTrigger (com.ctrip.xpipe.redis.meta.server.cluster.impl.ArrangeTaskTrigger)1 UnitTestServerConfig (com.ctrip.xpipe.redis.meta.server.config.UnitTestServerConfig)1 DefaultZkConfig (com.ctrip.xpipe.zk.impl.DefaultZkConfig)1 TestZkClient (com.ctrip.xpipe.zk.impl.TestZkClient)1 SpringApplication (org.springframework.boot.SpringApplication)1