本文整理了Java中org.apache.accumulo.fate.zookeeper.ZooReader.retryOrThrow()
方法的一些代码示例,展示了ZooReader.retryOrThrow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooReader.retryOrThrow()
方法的具体详情如下:
包路径:org.apache.accumulo.fate.zookeeper.ZooReader
类名称:ZooReader
方法名:retryOrThrow
暂无
代码示例来源:origin: apache/accumulo
@Override
public boolean exists(String zPath) throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, false) != null;
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public Stat getStatus(String zPath, Watcher watcher)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, watcher);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public Stat getStatus(String zPath) throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, false);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public List<String> getChildren(String zPath) throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getChildren(zPath, false);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public byte[] getData(String zPath, boolean watch, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getData(zPath, watch, stat);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public byte[] getData(String zPath, Watcher watcher, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getData(zPath, watcher, stat);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public List<String> getChildren(String zPath, Watcher watcher)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getChildren(zPath, watcher);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: apache/accumulo
@Override
public boolean exists(String zPath, Watcher watcher)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, watcher) != null;
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public byte[] getData(String zPath, boolean watch, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getData(zPath, watch, stat);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public boolean exists(String zPath) throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, false) != null;
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public Stat getStatus(String zPath) throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, false);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public List<String> getChildren(String zPath) throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getChildren(zPath, false);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public List<String> getChildren(String zPath, Watcher watcher)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getChildren(zPath, watcher);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public boolean exists(String zPath, Watcher watcher)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, watcher) != null;
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public byte[] getData(String zPath, Watcher watcher, Stat stat)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().getData(zPath, watcher, stat);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-fate
@Override
public Stat getStatus(String zPath, Watcher watcher)
throws KeeperException, InterruptedException {
final Retry retry = getRetryFactory().createRetry();
while (true) {
try {
return getZooKeeper().exists(zPath, watcher);
} catch (KeeperException e) {
final Code code = e.code();
if (code == Code.CONNECTIONLOSS || code == Code.OPERATIONTIMEOUT
|| code == Code.SESSIONEXPIRED) {
retryOrThrow(retry, e);
} else {
throw e;
}
}
retry.waitForNextAttempt();
}
}
内容来源于网络,如有侵权,请联系作者删除!