org.apache.accumulo.fate.zookeeper.ZooReader.retryOrThrow()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.apache.accumulo.fate.zookeeper.ZooReader.retryOrThrow()方法的一些代码示例,展示了ZooReader.retryOrThrow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooReader.retryOrThrow()方法的具体详情如下:
包路径:org.apache.accumulo.fate.zookeeper.ZooReader
类名称:ZooReader
方法名:retryOrThrow

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();
 }
}

相关文章