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

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


    checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    // Replay the first batch.
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 4, 2);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
   * Tests retrying a batch after the first one.
   */
 
View Full Code Here


    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(2);
    q.start(null);
    String checkpoint = null;
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    // We call q.resume but do not set checkpoint forward to reflect the
    // changes from the batch.
    checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    // Since we have not advanced checkpoint we replay the batch.
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
View Full Code Here

    q.start(null);
    String checkpoint = null;
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    // We call q.resume but do not set checkpoint forward to reflect the
    // changes from the batch.
    checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    // Since we have not advanced checkpoint we replay the batch.
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 4, 2);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }
View Full Code Here

    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 0, 2);
    // We call q.resume but do not set checkpoint forward to reflect the
    // changes from the batch.
    checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    // Since we have not advanced checkpoint we replay the batch.
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 4, 2);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
 
View Full Code Here

    // We call q.resume but do not set checkpoint forward to reflect the
    // changes from the batch.
    checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    // Since we have not advanced checkpoint we replay the batch.
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 4, 2);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
   * Tests resuming from a checkpoint that is half way through the first batch.
View Full Code Here

    // changes from the batch.
    checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    // Since we have not advanced checkpoint we replay the batch.
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 2, 2);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 4, 2);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
   * Tests resuming from a checkpoint that is half way through the first batch.
   */
 
View Full Code Here

    ChangeSource changeSource = new MockChangeSource(8);
    CheckpointAndChangeQueue q = new CheckpointAndChangeQueue(changeSource,
        persistDir, internalFactory, clientFactory);
    q.setMaximumQueueSize(3);
    q.start(null);
    Iterator<CheckpointAndChange> it = q.resume(null).iterator();
    CheckpointAndChange checkpointAndChange = it.next();
    MockChangeSource.validateChange(0, checkpointAndChange.getChange());
    assertTrue(it.hasNext());
    checkpointAndChange = it.next();
    MockChangeSource.validateChange(1, checkpointAndChange.getChange());
View Full Code Here

    assertTrue(it.hasNext());
    checkpointAndChange = it.next();
    MockChangeSource.validateChange(1, checkpointAndChange.getChange());
    assertTrue(it.hasNext());
    String checkpoint = checkChangesAndReturnLastCheckpoint(
        q.resume(checkpointAndChange.getCheckpoint().toString()), 2, 3);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 5, 3);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
 
View Full Code Here

    checkpointAndChange = it.next();
    MockChangeSource.validateChange(1, checkpointAndChange.getChange());
    assertTrue(it.hasNext());
    String checkpoint = checkChangesAndReturnLastCheckpoint(
        q.resume(checkpointAndChange.getCheckpoint().toString()), 2, 3);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 5, 3);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
   * Tests resume for a null checkpoint when the {@link ChangeSource} is empty.
View Full Code Here

    MockChangeSource.validateChange(1, checkpointAndChange.getChange());
    assertTrue(it.hasNext());
    String checkpoint = checkChangesAndReturnLastCheckpoint(
        q.resume(checkpointAndChange.getCheckpoint().toString()), 2, 3);
    checkpoint = checkChangesAndReturnLastCheckpoint(q.resume(checkpoint), 5, 3);
    assertFalse(q.resume(checkpoint).iterator().hasNext());
  }

  /**
   * Tests resume for a null checkpoint when the {@link ChangeSource} is empty.
   */
 
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.