當前位置: 首頁>>代碼示例>>Java>>正文


Java TestingServer.start方法代碼示例

本文整理匯總了Java中org.apache.curator.test.TestingServer.start方法的典型用法代碼示例。如果您正苦於以下問題:Java TestingServer.start方法的具體用法?Java TestingServer.start怎麽用?Java TestingServer.start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.curator.test.TestingServer的用法示例。


在下文中一共展示了TestingServer.start方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testServer

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
public void testServer(){
        try {
        TestingServer server=new TestingServer(2181,new File("/"));
        server.start();

        CuratorFramework curatorFramework = CuratorFrameworkFactory.
                builder().
                connectString(server.getConnectString()).
                sessionTimeoutMs(1000).
                retryPolicy(new RetryNTimes(3, 1000)).
                build();
        curatorFramework.start();
        System.out.println(curatorFramework.getChildren().forPath("/"));
        curatorFramework.close();
        server.stop();
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(1);
    }
}
 
開發者ID:mumudemo,項目名稱:mumu-zookeeper,代碼行數:21,代碼來源:CuratorServer.java

示例2: setup

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@BeforeClass
public static void setup() {
	actorSystem = AkkaUtils.createDefaultActorSystem();

	try {
		zkServer = new TestingServer();
		zkServer.start();
	} catch (Exception e) {
		e.printStackTrace();
		Assert.fail("Could not start ZooKeeper testing cluster.");
	}

	YARN_CONFIGURATION.set(YarnTestBase.TEST_CLUSTER_NAME_KEY, "flink-yarn-tests-ha");
	YARN_CONFIGURATION.set(YarnConfiguration.RM_AM_MAX_ATTEMPTS, "" + numberApplicationAttempts);

	startYARNWithConfig(YARN_CONFIGURATION);
}
 
開發者ID:axbaretto,項目名稱:flink,代碼行數:18,代碼來源:YARNHighAvailabilityITCase.java

示例3: beforeAll

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Before
public void beforeAll() throws Exception {
    server = new TestingServer();
    server.start();
    Capabilities mockCapabilities = Mockito.mock(Capabilities.class);
    when(mockCapabilities.supportsNamedVips()).thenReturn(true);
    taskFactory = new CassandraDaemonTask.Factory(mockCapabilities);
    configurationFactory = new ConfigurationFactory<>(
                    MutableSchedulerConfiguration.class,
                    BaseValidator.newValidator(),
                    Jackson.newObjectMapper()
                            .registerModule(new GuavaModule())
                            .registerModule(new Jdk8Module()),
                    "dw");
    connectString = server.getConnectString();
}
 
開發者ID:mesosphere,項目名稱:dcos-cassandra-service,代碼行數:17,代碼來源:ConfigurationManagerTest.java

示例4: start

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
public void start(Properties properties) throws Exception {
    Integer port = getZkPort(properties);
    zk = new TestingServer(port);
    zk.start();

    KafkaConfig kafkaConfig = new KafkaConfig(properties);
    kafka = new KafkaServerStartable(kafkaConfig);
    kafka.startup();
}
 
開發者ID:telstra,項目名稱:open-kilda,代碼行數:10,代碼來源:Original.java

示例5: initialize

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Before
public void initialize() throws Exception {
    distributedSequenceHandler = new DistributedSequenceHandler[16];
    MycatConfig mycatConfig = new MycatConfig();
    testingServer = new TestingServer();
    testingServer.start();
    for (int i = 0; i < 16; i++) {
        distributedSequenceHandler[i] = new DistributedSequenceHandler(mycatConfig.getSystem());
        distributedSequenceHandler[i].initializeZK(testingServer.getConnectString());
        distributedSequenceHandler[i].nextId("");
    }
}
 
開發者ID:huang-up,項目名稱:mycat-src-1.6.1-RELEASE,代碼行數:13,代碼來源:DistributedSequenceHandlerTest.java

示例6: initialize

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Before
public void initialize() throws Exception {
    testingServer = new TestingServer();
    testingServer.start();
    incrSequenceZKHandler = new IncrSequenceZKHandler[MAX_CONNECTION];
    results = new ConcurrentSkipListSet();
}
 
開發者ID:huang-up,項目名稱:mycat-src-1.6.1-RELEASE,代碼行數:8,代碼來源:IncrSequenceZKHandlerTest.java

示例7: init

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@BeforeClass
public static void init() throws Throwable {
    System.setProperty(Config.PROP_ENABLE_REALTIME_AGENT_LOG, "false");
    System.setProperty(Config.PROP_UPLOAD_AGENT_LOG, "false");
    System.setProperty(Config.PROP_REPORT_STATUS, "false");

    server = new TestingServer();
    server.start();
}
 
開發者ID:FlowCI,項目名稱:flow-platform,代碼行數:10,代碼來源:AgentManagerTest.java

示例8: initialize

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Before
public void initialize() throws Exception {
    distributedSequenceHandler = new DistributedSequenceHandler[16];
    testingServer = new TestingServer();
    testingServer.start();
    for (int i = 0; i < 16; i++) {
        distributedSequenceHandler[i] = new DistributedSequenceHandler();
        distributedSequenceHandler[i].initializeZK(testingServer.getConnectString());
        distributedSequenceHandler[i].nextId("");
    }
}
 
開發者ID:actiontech,項目名稱:dble,代碼行數:12,代碼來源:DistributedSequenceHandlerTest.java

示例9: main

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
public static void main(String[] args) {
	try {
		zkServer = new TestingServer(2181);
		zkServer.start();
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}	// TODO Auto-generated method stub

}
 
開發者ID:chenxh,項目名稱:rpc,代碼行數:11,代碼來源:RegistryMain.java

示例10: init

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@BeforeClass
public static void init(){
	try {
		zkServer = new TestingServer(2181);
		zkServer.start();
	} catch (Exception e) {
		e.printStackTrace();
	}
	
}
 
開發者ID:chenxh,項目名稱:rpc,代碼行數:11,代碼來源:ServiceDiscoveryTest.java

示例11: testExternalizedIncrementalRocksDBCheckpointsZookeeper

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Test
public void testExternalizedIncrementalRocksDBCheckpointsZookeeper() throws Exception {
	TestingServer zkServer = new TestingServer();
	zkServer.start();
	try {
		final File checkpointDir = temporaryFolder.newFolder();
		testExternalizedCheckpoints(
			checkpointDir,
			zkServer.getConnectString(),
			new RocksDBStateBackend(checkpointDir.toURI().toString(), true));
	} finally {
		zkServer.stop();
	}
}
 
開發者ID:axbaretto,項目名稱:flink,代碼行數:15,代碼來源:ExternalizedCheckpointITCase.java

示例12: setupCuratorServer

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Before
public void setupCuratorServer() throws Exception {
  curatorTestingServer = new TestingServer();
  curatorTestingServer.start();
  curatorFramework = CuratorFrameworkFactory.builder()
      .connectString(curatorTestingServer.getConnectString())
      .retryPolicy(new RetryNTimes(100, 100))
      .build();
  curatorFramework.start();
}
 
開發者ID:aliyun-beta,項目名稱:aliyun-oss-hadoop-fs,代碼行數:11,代碼來源:TestZKRMStateStore.java

示例13: alpha

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@BeforeClass
public static void alpha() throws Exception {
    zkServer = new TestingServer(PORT);

    zkServer.start();
    client = CuratorFrameworkFactory.newClient(CONNECT_STRING, new RetryUntilElapsed(1, 250));
    client.start();
}
 
開發者ID:RapturePlatform,項目名稱:Rapture,代碼行數:9,代碼來源:ZooKeeperLockHandlerTest.java

示例14: testExternalizedFSCheckpointsZookeeper

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Test
public void testExternalizedFSCheckpointsZookeeper() throws Exception {
	TestingServer zkServer = new TestingServer();
	zkServer.start();
	try {
		final File checkpointDir = temporaryFolder.newFolder();
		testExternalizedCheckpoints(
			checkpointDir,
			zkServer.getConnectString(),
			new FsStateBackend(checkpointDir.toURI().toString(), true));
	} finally {
		zkServer.stop();
	}
}
 
開發者ID:axbaretto,項目名稱:flink,代碼行數:15,代碼來源:ExternalizedCheckpointITCase.java

示例15: before

import org.apache.curator.test.TestingServer; //導入方法依賴的package包/類
@Before
public void before() throws Exception {
    zkServer = new TestingServer(2182);
    zkServer.start();
    zkUrl = zkServer.getConnectString();
    curator = RegisterHolder.getClient(zkUrl);
    namespace = "api-service";
}
 
開發者ID:netboynb,項目名稱:coco,代碼行數:9,代碼來源:CenterModelTest.java


注:本文中的org.apache.curator.test.TestingServer.start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。