java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
@Test(timeout = 100000)
  public void testLastPropagatedTimestamps() throws Exception {
    // Scan a table to ensure a timestamp is propagated.
    KuduTable table = syncClient.createTable(tableName, basicSchema, getBasicCreateTableOptions());
    syncClient.newScannerBuilder(table).build().nextRows().getNumRows();
    assertTrue(syncClient.hasLastPropagatedTimestamp());
    assertTrue(client.hasLastPropagatedTimestamp());

    long initial_ts = syncClient.getLastPropagatedTimestamp();

    // Check that the initial timestamp is consistent with the asynchronous client.
    assertEquals(initial_ts, client.getLastPropagatedTimestamp());
    assertEquals(initial_ts, syncClient.getLastPropagatedTimestamp());

    // Attempt to change the timestamp to a lower value. This should not change
    // the internal timestamp, as it must be monotonically increasing.
    syncClient.updateLastPropagatedTimestamp(initial_ts - 1);
    assertEquals(initial_ts, client.getLastPropagatedTimestamp());
    assertEquals(initial_ts, syncClient.getLastPropagatedTimestamp());

    // Use the synchronous client to update the last propagated timestamp and
    // check with both clients that the timestamp was updated.
    syncClient.updateLastPropagatedTimestamp(initial_ts + 1);
    assertEquals(initial_ts + 1, client.getLastPropagatedTimestamp());
    assertEquals(initial_ts + 1, syncClient.getLastPropagatedTimestamp());
  }
/**
   * Test setting and reading the most recent propagated timestamp.
   */
Test setting and reading the most recent propagated timestamp.
Test setting and reading the most recent propagated timestamp .
@Test(timeout = 100000)
  public void testLastPropagatedTimestamps() throws Exception {
    KuduTable table = syncClient.createTable(tableName, basicSchema, getBasicCreateTableOptions());
    syncClient.newScannerBuilder(table).build().nextRows().getNumRows();
    assertTrue(syncClient.hasLastPropagatedTimestamp());
    assertTrue(client.hasLastPropagatedTimestamp());
    long initial_ts = syncClient.getLastPropagatedTimestamp();
    assertEquals(initial_ts, client.getLastPropagatedTimestamp());
    assertEquals(initial_ts, syncClient.getLastPropagatedTimestamp());
    syncClient.updateLastPropagatedTimestamp(initial_ts - 1);
    assertEquals(initial_ts, client.getLastPropagatedTimestamp());
    assertEquals(initial_ts, syncClient.getLastPropagatedTimestamp());
    syncClient.updateLastPropagatedTimestamp(initial_ts + 1);
    assertEquals(initial_ts + 1, client.getLastPropagatedTimestamp());
    assertEquals(initial_ts + 1, syncClient.getLastPropagatedTimestamp());
  }
@ Test ( timeout = 100000 ) public void testLastPropagatedTimestamps ( ) throws Exception { KuduTable table = syncClient . createTable ( tableName , basicSchema , getBasicCreateTableOptions ( ) ) ; syncClient . newScannerBuilder ( table ) . build ( ) . nextRows ( ) . getNumRows ( ) ; assertTrue ( syncClient . hasLastPropagatedTimestamp ( ) ) ; assertTrue ( client . hasLastPropagatedTimestamp ( ) ) ; long initial_ts = syncClient . getLastPropagatedTimestamp ( ) ; assertEquals ( initial_ts , client . getLastPropagatedTimestamp ( ) ) ; assertEquals ( initial_ts , syncClient . getLastPropagatedTimestamp ( ) ) ; syncClient . updateLastPropagatedTimestamp ( initial_ts - 1 ) ; assertEquals ( initial_ts , client . getLastPropagatedTimestamp ( ) ) ; assertEquals ( initial_ts , syncClient . getLastPropagatedTimestamp ( ) ) ; syncClient . updateLastPropagatedTimestamp ( initial_ts + 1 ) ; assertEquals ( initial_ts + 1 , client . getLastPropagatedTimestamp ( ) ) ; assertEquals ( initial_ts + 1 , syncClient . getLastPropagatedTimestamp ( ) ) ; }
Test setting and reading the most recent propagated timestamp.
Test setting and reading the most recent propagated timestamp .
// Scan a table to ensure a timestamp is propagated. // Check that the initial timestamp is consistent with the asynchronous client. // Attempt to change the timestamp to a lower value. This should not change // the internal timestamp, as it must be monotonically increasing. // Use the synchronous client to update the last propagated timestamp and // check with both clients that the timestamp was updated.