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

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


  public void testReStart() throws IOException {
    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);
    q.start(null);
    assertTrue(0 == persistDir.listFiles().length);
View Full Code Here


    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);
    q.start(null);
    assertTrue(0 == persistDir.listFiles().length);
    List<CheckpointAndChange> firstBatchAgain = q.resume(null);
    assertEquals(firstBatch, firstBatchAgain);
  }
View Full Code Here

    ChangeSource changeSource = new MockChangeSource(NUM_RESUME_CALLS * 3);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        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);
    }
View Full Code Here

    }));
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    String checkpoint = null;
    q.start(checkpoint);

    List<CheckpointAndChange> batch = q.resume(checkpoint);
    Map<String, MonitorCheckpoint> monPoints = q.getMonitorRestartPoints();
    assertEquals(2, monPoints.size());
    assertTrue(monPoints.containsKey(MON_A));
View Full Code Here

    }));
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(15);
    String checkpoint = null;
    q.start(checkpoint);
    List<CheckpointAndChange> batch = q.resume(checkpoint);
    Map<String, MonitorCheckpoint> monPoints = q.getMonitorRestartPoints();
    assertEquals(5, monPoints.size());
    assertTrue(monPoints.containsKey(MON_A));
    assertTrue(monPoints.containsKey(MON_B));
View Full Code Here

    { /* Make recovery file that finishes 2nd batch. */
      ChangeSource changeSource = new MockChangeSource(6);
      CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
          persistDirSeed, internalFactory, clientFactory);
      q.setMaximumQueueSize(2);
      q.start(checkpoint);
      List<CheckpointAndChange> firstBatch = q.resume(checkpoint);
      checkpoint = firstBatch.get(1).getCheckpoint().toString();
      List<CheckpointAndChange> secondBatch = q.resume(checkpoint);
      checkpoint = secondBatch.get(1).getCheckpoint().toString();
      q.resume(checkpoint);
View Full Code Here

    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(checkpoint);
    // Note: It's important that q.resume(checkpoint) is not called.
    // That is start(checkpoint) loads the persisted monitor state.
    assertEquals(monPoints, q.getMonitorRestartPoints());
  }
View Full Code Here

    { /* Make recovery file that finishes 2nd batch. */
      ChangeSource changeSource = new MockChangeSource(6);
      CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
          persistDirSeed, internalFactory, clientFactory);
      q.setMaximumQueueSize(2);
      q.start(checkpoint);
      List<CheckpointAndChange> firstBatch = q.resume(checkpoint);
      checkpoint = firstBatch.get(1).getCheckpoint().toString();
      List<CheckpointAndChange> secondBatch = q.resume(checkpoint);
      checkpoint = secondBatch.get(0).getCheckpoint().toString();
      q.resume(checkpoint);
View Full Code Here

    ChangeSource changeSource = new MockChangeSource(6);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(checkpoint);
    // Note: It's important that q.resume(checkpoint) is not called.
    // That is start(checkpoint) loads the persisted monitor state.
    assertEquals(monPoints, q.getMonitorRestartPoints());
  }
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.