Package com.google.enterprise.connector.util.diffing

Examples of com.google.enterprise.connector.util.diffing.CheckpointAndChangeQueue.resume()


    CheckpointAndChangeQueue q4 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q4.setMaximumQueueSize(2);
    q4.start(checkpoint);
    List<CheckpointAndChange> secondBatchFourthTime = q4.resume(checkpoint);
    assertEquals(secondBatch, secondBatchFourthTime);
  }

  public void testRepeatedResumeAtSameCheckpointOfSameQueue() throws IOException {
    ChangeSource changeSource = new MockChangeSource(6);
View Full Code Here


    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String checkpoint = firstBatch.get(1).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
View Full Code Here

        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String checkpoint = firstBatch.get(1).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
View Full Code Here

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
    List<CheckpointAndChange> secondBatchAgain = q2.resume(checkpoint);
    assertEquals(secondBatch, secondBatchAgain);

    List<CheckpointAndChange> secondBatchThrice = q2.resume(checkpoint);
    assertEquals(secondBatch, secondBatchThrice);
  }
View Full Code Here

    q2.setMaximumQueueSize(2);
    q2.start(checkpoint);
    List<CheckpointAndChange> secondBatchAgain = q2.resume(checkpoint);
    assertEquals(secondBatch, secondBatchAgain);

    List<CheckpointAndChange> secondBatchThrice = q2.resume(checkpoint);
    assertEquals(secondBatch, secondBatchThrice);
  }

  public void testPartialRecovery() throws IOException {
    ChangeSource changeSource = new MockChangeSource(10);
View Full Code Here

    ChangeSource changeSource = new MockChangeSource(10);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(4);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String checkpoint = firstBatch.get(3).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);
    checkpoint = secondBatch.get(1).getCheckpoint().toString();

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
View Full Code Here

        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(4);
    q.start(null);
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String checkpoint = firstBatch.get(3).getCheckpoint().toString();
    List<CheckpointAndChange> secondBatch = q.resume(checkpoint);
    checkpoint = secondBatch.get(1).getCheckpoint().toString();

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(4);
View Full Code Here

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q2.setMaximumQueueSize(4);
    q2.start(checkpoint);
    List<CheckpointAndChange> secondBatchRedoEnd = q2.resume(checkpoint);
    assertEquals(secondBatch.get(2), secondBatchRedoEnd.get(0));
    assertEquals(secondBatch.get(3), secondBatchRedoEnd.get(1));
  }

  private String getRecoveryFile(CheckpointAndChangeQueue q) throws Exception {
View Full Code Here

    ChangeSource changeSource = new MockChangeSource(10);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.start(null);
    assertEquals(EMPTY_RECOVERY_FILE, getRecoveryFile(q));
    List<CheckpointAndChange> firstBatch = q.resume(null);
    String original = getRecoveryFile(q);

    CheckpointAndChangeQueue q2 = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    assertEquals(EMPTY_RECOVERY_FILE, getRecoveryFile(q2));
View Full Code Here

        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    String checkpoint = null;
    q.start(checkpoint);
    for (int i = 0; i < NUM_RESUME_CALLS; i++) {
       List<CheckpointAndChange> batch = q.resume(checkpoint);
       checkpoint = batch.get(1).getCheckpoint().toString();
       assertTrue(1 >= persistDir.listFiles().length);
    }
    assertTrue(1 == persistDir.listFiles().length);
  }
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.