Package com.google.walkaround.util.server

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


    log.info("Task to process: " + taskToProcess);
    final List<ImportTaskPayload> followupTasks = taskDispatcher.get().processTask(taskToProcess);
    // If the processing returns normally, the task has been completed.  (Other
    // tasks may have been scheduled.)
    try {
      new RetryHelper().run(
          new RetryHelper.VoidBody() {
            @Override public void run() throws RetryableFailure, PermanentFailure {
              CheckedTransaction tx = datastore.beginTransaction();
              try {
                if (perUserTable.getTask(tx, userId, taskId) == null) {
View Full Code Here


  private static final int MAX_WAVELETS_PER_TRANSACTION = 300;

  private void storeResults(List<RemoteConvWavelet> results) throws PermanentFailure {
    for (final List<RemoteConvWavelet> partition
        : Iterables.partition(results, MAX_WAVELETS_PER_TRANSACTION)) {
      new RetryHelper().run(
          new RetryHelper.VoidBody() {
            @Override public void run() throws RetryableFailure, PermanentFailure {
              CheckedTransaction tx = datastore.beginTransaction();
              try {
                if (perUserTable.addRemoteWavelets(tx, userId, partition)) {
View Full Code Here

      List<RobotSearchDigest> results, @Nullable final ImportSettings autoImportSettings)
      throws PermanentFailure {
    for (final List<RobotSearchDigest> partition : Iterables.partition(results,
            // 5 tasks per transaction.
            5)) {
      new RetryHelper().run(
          new RetryHelper.VoidBody() {
            @Override public void run() throws RetryableFailure, PermanentFailure {
              CheckedTransaction tx = datastore.beginTransaction();
              try {
                for (RobotSearchDigest result : partition) {
View Full Code Here

  private void scheduleImportTasks(List<RemoteConvWavelet> results,
      final ImportSettings autoImportSettings) throws PermanentFailure {
    for (final List<RemoteConvWavelet> partition : Iterables.partition(results,
            // 5 tasks per transaction.
            5)) {
      new RetryHelper().run(
          new RetryHelper.VoidBody() {
            @Override public void run() throws RetryableFailure, PermanentFailure {
              CheckedTransaction tx = datastore.beginTransaction();
              try {
                for (RemoteConvWavelet wavelet : partition) {
View Full Code Here

      return out.build();
    }

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

    return Iterables.concat(ImmutableList.of(internalPostCommit), actions);
  }

  public void taskInvoked(final SlobId slobId) {
    try {
      new RetryHelper().run(new RetryHelper.VoidBody() {
        @Override
        public void run() throws RetryableFailure, PermanentFailure {
          CheckedTransaction tx = datastore.beginTransaction();
          tx.put(new Entity(KeyFactory.createKey(
              MutationLog.makeRootEntityKey(rootEntityKind, slobId),
View Full Code Here

  }

  private BlobKey getBlobKey(final AppEngineFile finalizedBlobFile)
      throws IOException {
    try {
      return new RetryHelper().run(
          new RetryHelper.Body<BlobKey>() {
            @Override public BlobKey run() throws RetryableFailure, PermanentFailure {
              // HACK(ohler): The file service incorrectly uses the current
              // transaction.  Make a dummy transaction as a workaround.
              // Apparently it even needs to be XG.
View Full Code Here

    @Inject private WaveIndexer indexer;

    @Override
    public void reliableDelayedPostCommit(final SlobId slobId) {
      try {
        new RetryHelper().run(new RetryHelper.VoidBody() {
          @Override
          public void run() throws RetryableFailure, PermanentFailure {
            try {
              indexer.indexConversation(slobId);
            } catch (WaveletLockedException e) {
View Full Code Here

      this.removedParticipants = checkNotNull(removedParticipants, "Null removedParticipants");
    }

    @Override public void run() {
      try {
        new RetryHelper().run(new RetryHelper.VoidBody() {
          @Override
          public void run() throws RetryableFailure, PermanentFailure {
            try {
              GuiceSetup.getInjectorForTaskQueueTask().getInstance(WaveIndexer.class)
                  .unindexConversationForPossiblyRemovedParticipants(
View Full Code Here

    @Inject private WaveIndexer indexer;

    @Override
    public void reliableDelayedPostCommit(final SlobId slobId) {
      try {
        new RetryHelper().run(new RetryHelper.VoidBody() {
          @Override
          public void run() throws RetryableFailure, PermanentFailure {
            try {
              indexer.indexSupplement(slobId);
            } catch (WaveletLockedException e) {
View Full Code Here

TOP

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

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.