Package com.google.walkaround.util.server.RetryHelper

Examples of com.google.walkaround.util.server.RetryHelper.RetryableFailure


        return new Result(true);
      }

      @Override public void commit() throws RetryableFailure, PermanentFailure {
        // Always throw.
        throw new RetryableFailure();
      }

      @Override public void rollback() {
      }
    }
View Full Code Here


        return new Result(true);
      }

      @Override public void commit() throws RetryableFailure, PermanentFailure {
        // Always throw.
        throw new RetryableFailure();
      }
View Full Code Here

    // TODO(danilatos): Factor out all the error handling?
    AddResponse resp;
    try {
      resp = idx.add(doc);
    } catch (AddException e) {
      throw new RetryableFailure("Error indexing " + fields.slobId, e);
    }
    for (OperationResult result : resp) {
      if (!result.getCode().equals(StatusCode.OK)) {
        throw new RetryableFailure("Error indexing " + fields.slobId + ", " + result.getMessage());
      }
    }
  }
View Full Code Here

      throws RetryableFailure, PermanentFailure {
    if (randomChance(random, permanentFailureLikelihood)) {
      throw new PermanentFailure();
    }
    if (randomChance(random, retryableFailureLikelihood)) {
      throw new RetryableFailure();
    }
  }
View Full Code Here

 
  void rescheduleExistingTask(ImportTask task) throws RetryableFailure {
    try {
      taskQueue.add(makeTaskOptions(task.getUserId(), task.getTaskId()));
    } catch (TransientFailureException e) {
      throw new RetryableFailure(e);
    } catch (InternalFailureException e) {
      throw new RetryableFailure(e);
    }
  }
View Full Code Here

            new RetryHelper.Body<List<InboxDisplayRecord>>() {
              @Override public List<InboxDisplayRecord> run() throws RetryableFailure {
                try {
                  return getWavesInner();
                } catch (IOException e) {
                  throw new RetryableFailure(e);
                }
              }
            });
      } catch (PermanentFailure e) {
        throw new IOException("PermanentFailure reading index", e);
View Full Code Here

              try {
                BlobKey key = getFileService().getBlobKey(finalizedBlobFile);
                if (key == null) {
                  // I have the impression that this can happen because of HRD's
                  // eventual consistency.  Retry.
                  throw new RetryableFailure(this + ": getBlobKey() returned null");
                }
                return key;
              } finally {
                tx.close();
              }
View Full Code Here

                    inhibitPreAndPostCommit);
                convMetadataStore.put(tx, convId,
                    convMetadata != null ? convMetadata : new ConvMetadataGsonImpl());
                tx.commit();
              } catch (SlobAlreadyExistsException e) {
                throw new RetryableFailure("Slob id collision, retrying: " + convId, e);
              } catch (AccessDeniedException e) {
                throw new RuntimeException(
                    "Unexpected AccessDeniedException creating conv " + convId, e);
              } finally {
                tx.close();
View Full Code Here

              CheckedTransaction tx = datastore.beginTransaction();
              try {
                udwStore.newObject(tx, udwId, metadata, initialHistory, false);
                tx.commit();
              } catch (SlobAlreadyExistsException e) {
                throw new RetryableFailure("Slob id collision, retrying: " + udwId, e);
              } catch (AccessDeniedException e) {
                throw new RuntimeException(
                    "Unexpected AccessDeniedException creating udw " + udwId, e);
              } finally {
                tx.close();
View Full Code Here

  private static <T> T safeRun(Evaluater<T> runnable) throws PermanentFailure, RetryableFailure {
    try {
      return runnable.run();
    } catch (DatastoreTimeoutException e) {
      throw new RetryableFailure(e);
    } catch (ConcurrentModificationException e) {
      throw new RetryableFailure(e);
    } catch (DatastoreFailureException e) {
      throw new PermanentFailure(e);
    } catch (DatastoreNeedIndexException e) {
      throw new PermanentFailure(e);
    } catch (PreparedQuery.TooManyResultsException e) {
View Full Code Here

TOP

Related Classes of com.google.walkaround.util.server.RetryHelper.RetryableFailure

Copyright © 2018 www.massapicom. 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.