Examples of PruneJobUpdateHistory


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

  @Test
  public void testPruneHistory() {
    Set<String> pruned = ImmutableSet.of("a", "b");
    expect(jobUpdateStore.pruneHistory(1, 1)).andReturn(pruned);
    expectOp(Op.pruneJobUpdateHistory(new PruneJobUpdateHistory(1, 1)));

    control.replay();

    storage.pruneHistory(1, 1);
  }
View Full Code Here

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

    builder.add(createTransaction(Op.saveJobInstanceUpdateEvent(saveInstanceEvent)));
    storageUtil.jobUpdateStore.saveJobInstanceUpdateEvent(
        IJobInstanceUpdateEvent.build(saveInstanceEvent.getEvent()),
        saveInstanceEvent.getUpdateId());

    builder.add(createTransaction(Op.pruneJobUpdateHistory(new PruneJobUpdateHistory(5, 10L))));
    expect(storageUtil.jobUpdateStore.pruneHistory(5, 10L)).andReturn(ImmutableSet.of("id2"));

    // NOOP LogEntry
    builder.add(LogEntry.noop(true));
View Full Code Here

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

    }.run();
  }

  @Test
  public void testPruneHistory() throws Exception {
    final PruneJobUpdateHistory pruneHistory = new PruneJobUpdateHistory()
        .setHistoryPruneThresholdMs(1L)
        .setPerJobRetainCount(1);

    new MutationFixture() {
      @Override
      protected void setupExpectations() throws Exception {
        storageUtil.expectWriteOperation();
        expect(storageUtil.jobUpdateStore.pruneHistory(
            pruneHistory.getPerJobRetainCount(),
            pruneHistory.getHistoryPruneThresholdMs())).andReturn(ImmutableSet.of("id1"));

        streamMatcher.expectTransaction(Op.pruneJobUpdateHistory(pruneHistory)).andReturn(position);
      }

      @Override
      protected void performMutations(MutableStoreProvider storeProvider) {
        storeProvider.getJobUpdateStore().pruneHistory(
            pruneHistory.getPerJobRetainCount(),
            pruneHistory.getHistoryPruneThresholdMs());
      }
    }.run();
  }
View Full Code Here

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

      // So, persisting pruning attempts is not strictly necessary as the periodic pruner will
      // provide eventual consistency between volatile and persistent storage upon scheduler
      // restart. By generating an out of band pruning during log replay the consistency is
      // achieved sooner without potentially exposing pruned but not yet persisted data.
      write(Op.pruneJobUpdateHistory(
          new PruneJobUpdateHistory(perJobRetainCount, historyPruneThresholdMs)));
    }
    return prunedUpdates;
  }
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.