Examples of shouldRetry()


Examples of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy.shouldRetry()

        for (int i = 0; i < 10; i++) {
            switch (i) {
            case 0:
            case 1:
                assertTrue(policy.shouldRetry(i));
                break;
            default:
                assertFalse(policy.shouldRetry(i));
            }
        }
View Full Code Here

Examples of org.apache.camel.processor.aggregate.OptimisticLockRetryPolicy.shouldRetry()

            case 0:
            case 1:
                assertTrue(policy.shouldRetry(i));
                break;
            default:
                assertFalse(policy.shouldRetry(i));
            }
        }
    }
}
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

    long pause = getConfiguration().getLong(HConstants.HBASE_CLIENT_PAUSE,
      HConstants.DEFAULT_HBASE_CLIENT_PAUSE);
    int numRetries = getConfiguration().getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
      HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
    RetryCounter retrier = new RetryCounter(numRetries, (int)pause, TimeUnit.MICROSECONDS);
    while(retrier.shouldRetry()) {
      int index = getMiniHBaseCluster().getServerWith(firstrow);
      if (index != -1) {
        return getMiniHBaseCluster().getRegionServerThreads().get(index).getRegionServer();
      }
      // Came back -1.  Region may not be online yet.  Sleep a while.
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

    long pause = getConfiguration().getLong(HConstants.HBASE_CLIENT_PAUSE,
      HConstants.DEFAULT_HBASE_CLIENT_PAUSE);
    int numRetries = getConfiguration().getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
      HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
    RetryCounter retrier = new RetryCounter(numRetries+1, (int)pause, TimeUnit.MICROSECONDS);
    while(retrier.shouldRetry()) {
      int index = getMiniHBaseCluster().getServerWith(firstrow);
      if (index != -1) {
        return getMiniHBaseCluster().getRegionServerThreads().get(index).getRegionServer();
      }
      // Came back -1.  Region may not be online yet.  Sleep a while.
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

    long pause = getConfiguration().getLong(HConstants.HBASE_CLIENT_PAUSE,
      HConstants.DEFAULT_HBASE_CLIENT_PAUSE);
    int numRetries = getConfiguration().getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER,
      HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER);
    RetryCounter retrier = new RetryCounter(numRetries+1, (int)pause, TimeUnit.MICROSECONDS);
    while(retrier.shouldRetry()) {
      int index = getMiniHBaseCluster().getServerWith(firstrow);
      if (index != -1) {
        return getMiniHBaseCluster().getRegionServerThreads().get(index).getRegionServer();
      }
      // Came back -1.  Region may not be online yet.  Sleep a while.
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

      } catch (KeeperException e) {
        switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: " + e);
            if (!retryCounter.shouldRetry()) {
              LOG.error("ZooKeeper setData failed after "
                + retryCounter.getMaxRetries() + " retries");
              throw e;
            }
            break;
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

            throw e;

          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: " + e);
            if (!retryCounter.shouldRetry()) {
              LOG.error("ZooKeeper create failed after "
                + retryCounter.getMaxRetries() + " retries");
              throw e;
            }
            break;
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

      } catch (KeeperException e) {
        switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: " + e);
            if (!retryCounter.shouldRetry()) {
              LOG.error("ZooKeeper create failed after "
                + retryCounter.getMaxRetries() + " retries");
              throw e;
            }
            break;
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

            throw e;

          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: " + e);
            if (!retryCounter.shouldRetry()) {
              LOG.error("ZooKeeper delete failed after "
                + retryCounter.getMaxRetries() + " retries");
              throw e;
            }
            break;
View Full Code Here

Examples of org.apache.hadoop.hbase.util.RetryCounter.shouldRetry()

      } catch (KeeperException e) {
        switch (e.code()) {
          case CONNECTIONLOSS:
          case OPERATIONTIMEOUT:
            LOG.warn("Possibly transient ZooKeeper exception: " + e);
            if (!retryCounter.shouldRetry()) {
              LOG.error("ZooKeeper exists failed after "
                + retryCounter.getMaxRetries() + " retries");
              throw e;
            }
            break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.