本文整理匯總了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);
}
}
示例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);
}
示例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();
}
示例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();
}
示例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("");
}
}
示例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();
}
示例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();
}
示例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("");
}
}
示例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
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
}
示例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";
}