- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.I0Itec.zkclient.ZkClient.waitUntilConnected()
方法的一些代码示例,展示了ZkClient.waitUntilConnected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.waitUntilConnected()
方法的具体详情如下:
包路径:org.I0Itec.zkclient.ZkClient
类名称:ZkClient
方法名:waitUntilConnected
暂无
代码示例来源:origin: apache/incubator-pinot
client.waitUntilConnected(10L, TimeUnit.SECONDS);
client.close();
代码示例来源:origin: apache/incubator-pinot
public DynamicBrokerSelector(String zkServers) {
ZkClient zkClient = new ZkClient(zkServers);
zkClient.setZkSerializer(new BytesPushThroughSerializer());
zkClient.waitUntilConnected(60, TimeUnit.SECONDS);
zkClient.subscribeDataChanges(ExternalViewReader.BROKER_EXTERNAL_VIEW_PATH, this);
evReader = new ExternalViewReader(zkClient);
refresh();
}
代码示例来源:origin: uber/chaperone
client.waitUntilConnected(10L, TimeUnit.SECONDS);
client.close();
代码示例来源:origin: com.101tec/zkclient
private void waitForRetry() {
if (_operationRetryTimeoutInMillis < 0) {
waitUntilConnected();
return;
}
waitUntilConnected(_operationRetryTimeoutInMillis, TimeUnit.MILLISECONDS);
}
代码示例来源:origin: com.github.sgroschupf/zkclient
public void waitUntilConnected() throws ZkInterruptedException {
waitUntilConnected(Integer.MAX_VALUE, TimeUnit.MILLISECONDS);
}
代码示例来源:origin: com.101tec/zkclient
public void waitUntilConnected() throws ZkInterruptedException {
waitUntilConnected(Integer.MAX_VALUE, TimeUnit.MILLISECONDS);
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
/**
* {@inheritDoc}
*/
@Override
public void init() {
zkClient.waitUntilConnected(zkConfig.getZkConnectionTimeoutMs(), TimeUnit.MILLISECONDS);
}
代码示例来源:origin: apache/samza
/**
* {@inheritDoc}
*/
@Override
public void init() {
zkClient.waitUntilConnected(zkConfig.getZkConnectionTimeoutMs(), TimeUnit.MILLISECONDS);
}
代码示例来源:origin: apache/samza
public void connect() throws ZkInterruptedException {
boolean isConnected = zkClient.waitUntilConnected(connectionTimeoutMs, TimeUnit.MILLISECONDS);
if (!isConnected) {
metrics.zkConnectionError.inc();
throw new RuntimeException("Unable to connect to Zookeeper within connectionTimeout " + connectionTimeoutMs + "ms. Shutting down!");
}
}
代码示例来源:origin: org.apache.samza/samza-core
/**
* {@inheritDoc}
*/
@Override
public void init() {
zkClient.waitUntilConnected(zkConfig.getZkConnectionTimeoutMs(), TimeUnit.MILLISECONDS);
}
代码示例来源:origin: org.apache.samza/samza-core
public void connect() throws ZkInterruptedException {
boolean isConnected = zkClient.waitUntilConnected(connectionTimeoutMs, TimeUnit.MILLISECONDS);
if (!isConnected) {
metrics.zkConnectionError.inc();
throw new RuntimeException("Unable to connect to Zookeeper within connectionTimeout " + connectionTimeoutMs + "ms. Shutting down!");
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.11
public void connect() throws ZkInterruptedException {
boolean isConnected = zkClient.waitUntilConnected(connectionTimeoutMs, TimeUnit.MILLISECONDS);
if (!isConnected) {
metrics.zkConnectionError.inc();
throw new RuntimeException("Unable to connect to Zookeeper within connectionTimeout " + connectionTimeoutMs + "ms. Shutting down!");
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
/**
* {@inheritDoc}
*/
@Override
public void init() {
zkClient.waitUntilConnected(zkConfig.getZkConnectionTimeoutMs(), TimeUnit.MILLISECONDS);
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
/**
* {@inheritDoc}
*/
@Override
public void init() {
zkClient.waitUntilConnected(zkConfig.getZkConnectionTimeoutMs(), TimeUnit.MILLISECONDS);
}
代码示例来源:origin: org.apache.samza/samza-core_2.10
public void connect() throws ZkInterruptedException {
boolean isConnected = zkClient.waitUntilConnected(connectionTimeoutMs, TimeUnit.MILLISECONDS);
if (!isConnected) {
metrics.zkConnectionError.inc();
throw new RuntimeException("Unable to connect to Zookeeper within connectionTimeout " + connectionTimeoutMs + "ms. Shutting down!");
}
}
代码示例来源:origin: org.apache.samza/samza-core_2.12
public void connect() throws ZkInterruptedException {
boolean isConnected = zkClient.waitUntilConnected(connectionTimeoutMs, TimeUnit.MILLISECONDS);
if (!isConnected) {
metrics.zkConnectionError.inc();
throw new RuntimeException("Unable to connect to Zookeeper within connectionTimeout " + connectionTimeoutMs + "ms. Shutting down!");
}
}
代码示例来源:origin: XiaoMi/shepher
@Override
public boolean validateObject(String key, PooledObject<ZkClient> pooledObject) {
return pooledObject.getObject().waitUntilConnected(ZKPOOL_KEEPSTATE_TIME, TimeUnit.MILLISECONDS);
}
代码示例来源:origin: Microsoft/Availability-Monitor-for-Kafka
private static ZkClient fromCurator(CuratorFramework curatorFramework) {
// Note: You must initialize the ZkClient with ZKStringSerializer. If you don't, then
// createTopic() will only seem to work (it will return without error). The topic will exist in
// only ZooKeeper and will be returned when listing topics, but Kafka itself does not create the topic.
ZkClient zkClient = new ZkClient(curatorFramework.getZookeeperClient().getCurrentConnectionString(), sessionTimeOutInMs, connectionTimeOutInMs, ZKStringSerializer$.MODULE$);
zkClient.waitUntilConnected();
return zkClient;
}
代码示例来源:origin: linkedin/li-apache-kafka-clients
@Test
public void testSimpleScenario() throws Exception {
String connectionString;
String host;
int port;
try (EmbeddedZookeeper zk = new EmbeddedZookeeper()) {
connectionString = zk.getConnectionString();
host = zk.getHostAddress();
port = zk.getPort();
Assert.assertEquals(host + ":" + port, connectionString);
ZkClient client = new ZkClient(connectionString);
try {
String path = "/" + UUID.randomUUID().toString();
client.waitUntilConnected(5, TimeUnit.SECONDS);
client.create(path, "payload", CreateMode.PERSISTENT);
Assert.assertEquals("payload", client.readData(path));
} finally {
client.close();
}
}
//now verify shut down
try {
new Socket(host, port);
Assert.fail("expected to fail");
} catch (ConnectException ignored) {
}
}
}
代码示例来源:origin: com.github.sgroschupf/zkclient
if (!waitUntilConnected(maxMsToWaitUntilConnected, TimeUnit.MILLISECONDS)) {
throw new ZkTimeoutException("Unable to connect to zookeeper server within timeout: " + maxMsToWaitUntilConnected);
我是一名优秀的程序员,十分优秀!