Examples of DeltaIterator


Examples of com.google.walkaround.slob.server.MutationLog.DeltaIterator

              @Override public void blobDeleted(
                  Key entityKey, MovableProperty property, BlobKey blobKey) {
                throw new AssertionError();
              }
            });
    DeltaIterator deltas = mutationLog2.forwardHistory(0, null);
    assertEquals("delta 0 " + massiveString, deltas.next().getPayload());
    assertEquals("delta 1 " + massiveString, deltas.next().getPayload());
    assertEquals("delta 2 " + massiveString, deltas.next().getPayload());
    assertEquals("delta 3 " + massiveString, deltas.next().getPayload());
    assertFalse(deltas.hasNext());
  }
View Full Code Here

Examples of com.google.walkaround.slob.server.MutationLog.DeltaIterator

    final int MAX_MILLIS = 3 * 1000;
    try {
      CheckedTransaction tx = datastore.beginTransaction();
      try {
        // TODO(ohler): put current version into cache
        DeltaIterator result = mutationLogFactory.create(tx, slobId).forwardHistory(
            startVersion, endVersion);
        if (!result.hasNext()) {
          return new HistoryResult(ImmutableList.<ChangeData<String>>of(), false);
        }
        ImmutableList.Builder<ChangeData<String>> list = ImmutableList.builder();
        Stopwatch stopwatch = new Stopwatch().start();
        do {
          list.add(result.next());
        } while (result.hasNext() && stopwatch.elapsedMillis() < MAX_MILLIS);
        return new HistoryResult(list.build(), result.hasNext());
      } finally {
        tx.rollback();
      }
    } catch (PermanentFailure e) {
      throw new IOException(e);
View Full Code Here

Examples of com.google.walkaround.slob.server.MutationLog.DeltaIterator

          MutationLog mutationLog = storeSelector.get(storeType).getMutationLogFactory()
              .create(tx, objectId);
          objectVersion = mutationLog.getVersion();
          if (!historyStart.isEmpty()) {
            long start = Long.parseLong(historyStart);
            DeltaIterator it = mutationLog.forwardHistory(start,
                historyEnd.isEmpty() ? start + 1000 : Long.parseLong(historyEnd));
            for (long version = start; it.hasNext(); version++) {
              items.add(Pair.of(version, "" + it.next()));
            }
          }
          if (!snapshotVersion.isEmpty()) {
            snapshot = mutationLog.reconstruct(Long.parseLong(snapshotVersion))
                .getState().snapshot();
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.