- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.accumulo.fate.zookeeper.ZooUtil.getZooKeeper()
方法的一些代码示例,展示了ZooUtil.getZooKeeper()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooUtil.getZooKeeper()
方法的具体详情如下:
包路径:org.apache.accumulo.fate.zookeeper.ZooUtil
类名称:ZooUtil
方法名:getZooKeeper
暂无
代码示例来源:origin: apache/accumulo
protected static ZooKeeper getZooKeeper(ZooKeeperConnectionInfo info) {
return getZooKeeper(info.keepers, info.timeout, info.scheme, info.auth);
}
代码示例来源:origin: apache/accumulo
public static boolean isLockHeld(ZooKeeperConnectionInfo info, LockID lid)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
List<String> children = getZooKeeper(info).getChildren(lid.path, false);
if (children.size() == 0) {
return false;
}
Collections.sort(children);
String lockNode = children.get(0);
if (!lid.node.equals(lockNode))
return false;
Stat stat = getZooKeeper(info).exists(lid.path + "/" + lid.node, false);
return stat != null && stat.getEphemeralOwner() == lid.eid;
} catch (KeeperException ex) {
final Code c = ex.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, ex);
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
public static Stat getStatus(ZooKeeperConnectionInfo info, String zPath)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).exists(zPath, false);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
public static byte[] getData(ZooKeeperConnectionInfo info, String zPath, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).getData(zPath, false, stat);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
public static String putEphemeralData(ZooKeeperConnectionInfo info, String zPath, byte[] data)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).create(zPath, data, ZooUtil.PUBLIC, CreateMode.EPHEMERAL);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
public static String putPersistentSequential(ZooKeeperConnectionInfo info, String zPath,
byte[] data) throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).create(zPath, data, ZooUtil.PUBLIC,
CreateMode.PERSISTENT_SEQUENTIAL);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
public static String putEphemeralSequential(ZooKeeperConnectionInfo info, String zPath,
byte[] data) throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).create(zPath, data, ZooUtil.PUBLIC,
CreateMode.EPHEMERAL_SEQUENTIAL);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
while (true) {
try {
getZooKeeper(info).create(zPath, data, acls, mode);
return true;
} catch (KeeperException e) {
getZooKeeper(info).setData(zPath, data, version);
return true;
} catch (KeeperException e2) {
代码示例来源:origin: apache/accumulo
public static List<ACL> getACL(ZooKeeperConnectionInfo info, String zPath, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).getACL(zPath, stat);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
while (true) {
try {
children = getZooKeeper(info).getChildren(zPath, false);
break;
} catch (KeeperException e) {
while (true) {
try {
stat = getZooKeeper(info).exists(zPath, null);
getZooKeeper(info).delete(zPath, -1);
return;
} catch (NoNodeException e) {
代码示例来源:origin: org.apache.accumulo/accumulo-fate
protected static ZooKeeper getZooKeeper(ZooKeeperConnectionInfo info) {
return getZooKeeper(info.keepers, info.timeout, info.scheme, info.auth);
}
代码示例来源:origin: apache/accumulo
while (true) {
try {
children = getZooKeeper(info).getChildren(source, false);
break;
} catch (KeeperException e) {
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static boolean isLockHeld(ZooKeeperConnectionInfo info, LockID lid)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
List<String> children = getZooKeeper(info).getChildren(lid.path, false);
if (children.size() == 0) {
return false;
}
Collections.sort(children);
String lockNode = children.get(0);
if (!lid.node.equals(lockNode))
return false;
Stat stat = getZooKeeper(info).exists(lid.path + "/" + lid.node, false);
return stat != null && stat.getEphemeralOwner() == lid.eid;
} catch (KeeperException ex) {
final Code c = ex.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, ex);
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static byte[] getData(ZooKeeperConnectionInfo info, String zPath, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).getData(zPath, false, stat);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static String putEphemeralData(ZooKeeperConnectionInfo info, String zPath, byte[] data)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).create(zPath, data, ZooUtil.PUBLIC, CreateMode.EPHEMERAL);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static Stat getStatus(ZooKeeperConnectionInfo info, String zPath)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).exists(zPath, false);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static String putPersistentSequential(ZooKeeperConnectionInfo info, String zPath,
byte[] data) throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).create(zPath, data, ZooUtil.PUBLIC,
CreateMode.PERSISTENT_SEQUENTIAL);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static String putEphemeralSequential(ZooKeeperConnectionInfo info, String zPath,
byte[] data) throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).create(zPath, data, ZooUtil.PUBLIC,
CreateMode.EPHEMERAL_SEQUENTIAL);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
public static List<ACL> getACL(ZooKeeperConnectionInfo info, String zPath, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = RETRY_FACTORY.createRetry();
while (true) {
try {
return getZooKeeper(info).getACL(zPath, stat);
} catch (KeeperException e) {
final Code c = e.code();
if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
while (true) {
try {
children = getZooKeeper(info).getChildren(source, false);
break;
} catch (KeeperException e) {
本文整理了Java中org.apache.pulsar.zookeeper.ZooKeeperCache.getZooKeeper()方法的一些代码示例,展示了ZooKeeperCache.getZo
本文整理了Java中com.yahoo.pulsar.zookeeper.ZooKeeperCache.getZooKeeper()方法的一些代码示例,展示了ZooKeeperCache.getZoo
本文整理了Java中org.apache.accumulo.core.client.ZooKeeperInstance.getZooKeepers()方法的一些代码示例,展示了ZooKeeperIns
本文整理了Java中org.apache.accumulo.server.zookeeper.ZooReaderWriter.getZooKeeper()方法的一些代码示例,展示了ZooReaderW
本文整理了Java中org.apache.accumulo.fate.zookeeper.ZooReaderWriter.getZooKeeper()方法的一些代码示例,展示了ZooReaderWri
本文整理了Java中org.apache.accumulo.fate.zookeeper.ZooUtil.getZooKeeper()方法的一些代码示例,展示了ZooUtil.getZooKeeper
本文整理了Java中org.apache.helix.manager.zk.zookeeper.ZkConnection.getZookeeper()方法的一些代码示例,展示了ZkConnection
我是一名优秀的程序员,十分优秀!