Package com.google.appengine.tools.pipeline

Examples of com.google.appengine.tools.pipeline.NoSuchObjectException


        attempts++;
        try {
          slot = backEnd.querySlot(key, false);
        } catch (NoSuchObjectException e) {
          if (attempts >= 5) {
            throw new NoSuchObjectException("There is no promise with handle " + promiseHandle);
          }
          try {
            Thread.sleep((long) Math.pow(2.0, attempts - 1) * 1000L);
          } catch (InterruptedException f) {
            interrupted = true;
          }
        }
      }
    } finally {
      // TODO(user): replace with Uninterruptibles#sleepUninterruptibly once we use guava
      if (interrupted) {
        Thread.currentThread().interrupt();
      }
    }
    Key generatorJobKey = slot.getGeneratorJobKey();
    if (null == generatorJobKey) {
      throw new RuntimeException(
          "Pipeline is fatally corrupted. Slot for promised value has no generatorJobKey: " + slot);
    }
    JobRecord generatorJob = backEnd.queryJob(generatorJobKey, JobRecord.InflationType.NONE);
    if (null == generatorJob) {
      throw new RuntimeException("Pipeline is fatally corrupted. "
          + "The generator job for a promised value slot was not found: " + generatorJobKey);
    }
    String childGraphGuid = generatorJob.getChildGraphGuid();
    if (null == childGraphGuid) {
      // The generator job has not been saved with a childGraphGuid yet. This can happen if the
      // promise handle leaked out to an external thread before the job that generated it
      // had finished.
      throw new NoSuchObjectException(
          "The framework is not ready to accept the promised value yet. "
          + "Please try again after the job that generated the promis handle has completed.");
    }
    if (!childGraphGuid.equals(slot.getGraphGuid())) {
      // The slot has been orphaned
View Full Code Here


        }
      });
    } catch (NonRetriableException|RetriesExhaustedException e) {
      Throwable cause = e.getCause();
      if (cause instanceof EntityNotFoundException) {
        throw new NoSuchObjectException(key.toString(), cause);
      } else {
        throw e;
      }
    }
  }
View Full Code Here

          // ignore
        }
      }
    }
    if (null == slot) {
      throw new NoSuchObjectException("There is no promise with handle " + promiseHandle);
    }
    Key generatorJobKey = slot.getGeneratorJobKey();
    if (null == generatorJobKey) {
      throw new RuntimeException(
          "Pipeline is fatally corrupted. Slot for promised value has no generatorJobKey: "
          + slot);
    }
    JobRecord generatorJob = backEnd.queryJob(generatorJobKey, JobRecord.InflationType.NONE);
    if (null == generatorJob) {
      throw new RuntimeException("Pipeline is fatally corrupted. "
          + "The generator job for a promised value slot was not found: " + generatorJobKey);
    }
    String childGraphGuid = generatorJob.getChildGraphGuid();
    if (null == childGraphGuid) {
      // The generator job has not been saved with a childGraphGuid yet. This
      // can happen if
      // the promise handle leaked out to an external thread before the job that
      // generated it
      // had finished.
      throw new NoSuchObjectException(
          "The framework is not ready to accept the promised value yet. "
          + "Please try again after the job that generated the promis handle has completed.");
    }
    if (!childGraphGuid.equals(slot.getGraphGuid())) {
      // The slot has been orphaned
View Full Code Here

      }
      jobRecord.inflate(runBarrier, finalizeBarrier, outputSlot, jobInstanceRecord);
      logger.finest("Query returned: " + jobRecord);
      return jobRecord;
    } catch (EntityNotFoundException e) {
      throw new NoSuchObjectException(jobKey.toString(), e);
    }
  }
View Full Code Here

      Map<Key, Entity> results = dataStore.get(null, batch);
      if (results.size() != batch.size()) {
        List<Key> missing = new ArrayList<Key>(batch);
        missing.removeAll(results.keySet());
        logger.severe("Missing entities for keys: " + missing + " (and perhaps others)");
        throw new NoSuchObjectException("" + missing.get(0));
      }
      out.putAll(results);
      start = end;
    }
    return out;
View Full Code Here

  public Slot querySlot(Key slotKey, boolean inflate) throws NoSuchObjectException {
    Entity entity;
    try {
      entity = transactionallyQueryEntity(slotKey);
    } catch (EntityNotFoundException e) {
      throw new NoSuchObjectException(slotKey.toString(), e);
    }
    Slot slot = new Slot(entity);
    if (inflate) {
      Map<Key, Entity> entities = getAll(slot.getWaitingOnMeKeys());
      Map<Key, Barrier> barriers = new HashMap<Key, Barrier>(entities.size());
View Full Code Here

    // Fetch the fanoutTaskRecord outside of any transaction
    Entity entity = null;
    try {
      entity = dataStore.get(null, fanoutTaskRecordKey);
    } catch (EntityNotFoundException e) {
      throw new NoSuchObjectException(fanoutTaskRecordKey.toString(), e);
    }
    FanoutTaskRecord ftRecord = new FanoutTaskRecord(entity);
    byte[] encodedBytes = ftRecord.getPayload();
    taskQueue.enqueue(FanoutTask.decodeTasks(encodedBytes));
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.pipeline.NoSuchObjectException

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.