Package org.apache.aurora.gen.storage

Examples of org.apache.aurora.gen.storage.Snapshot


    @Timed("snapshot_deduplicate")
    public DeduplicatedSnapshot deduplicate(Snapshot snapshot) {
      int numInputTasks = snapshot.getTasksSize();
      LOG.info(String.format("Starting deduplication of a snapshot with %d tasks.", numInputTasks));

      Snapshot partialSnapshot = snapshot.deepCopy();
      partialSnapshot.unsetTasks();

      DeduplicatedSnapshot deduplicatedSnapshot = new DeduplicatedSnapshot()
          .setPartialSnapshot(partialSnapshot);

      // Nothing to do if we don't have any input tasks.
View Full Code Here


    @Override
    @Timed("snapshot_reduplicate")
    public Snapshot reduplicate(DeduplicatedSnapshot deduplicatedSnapshot) throws CodingException {
      LOG.info("Starting reduplication.");
      Snapshot snapshot = new Snapshot(deduplicatedSnapshot.getPartialSnapshot());
      if (!deduplicatedSnapshot.isSetTaskConfigs()) {
        LOG.warning("Got deduplicated snapshot with unset task configs.");
        return snapshot;
      }

      for (DeduplicatedScheduledTask partialTask : deduplicatedSnapshot.getPartialTasks()) {
        ScheduledTask scheduledTask = new ScheduledTask(partialTask.getPartialScheduledTask());
        int taskConfigId = partialTask.getTaskConfigId();
        TaskConfig config;
        try {
          config = deduplicatedSnapshot.getTaskConfigs().get(taskConfigId);
        } catch (IndexOutOfBoundsException e) {
          throw new CodingException(
              "DeduplicatedScheduledTask referenced invalid task index " + taskConfigId, e);
        }
        scheduledTask.getAssignedTask().setTask(config);
        snapshot.addToTasks(scheduledTask);
      }

      int numInputTasks = deduplicatedSnapshot.getTaskConfigsSize();
      int numOutputTasks = snapshot.getTasksSize();
      LOG.info(String.format(
          "Finished reduplicating snapshot. Compression ratio: %d/%d = %.2f%%.",
          numInputTasks,
          numOutputTasks,
          100.0 * numInputTasks / numOutputTasks));
View Full Code Here

TOP

Related Classes of org.apache.aurora.gen.storage.Snapshot

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.