Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12689 )
Change subject: [java] Add private diff scan support ...................................................................... Patch Set 12: (1 comment) http://gerrit.cloudera.org:8080/#/c/12689/12/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java File java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java: http://gerrit.cloudera.org:8080/#/c/12689/12/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduScanner.java@193 PS12, Line 193: physical time Incrementing the physical time doesn't seem right; doesn't it allow for 'mutations' to be assigned a timestamp _below_ startHT (i.e. same physical time but higher logical time)? Why not increment the logical time? Or better yet, how about incrementing the _encoded_ timestamp by 1 without decoding it at all? There's a snippet in client.h (it's been removed by Hao on master) that suggests this is OK: /// How to get Read-Your-Writes consistency: /// the code snippet below uses KuduClient::GetLatestObservedTimestamp() along /// with KuduScanner::SetSnapshotRaw() to perform READ_AT_SNAPSHOT scan /// containing the data which has just been written. Notice extra 1 /// added to the timestamp passed to KuduScanner::SetSnapshotRaw(): /// @code /// shared_ptr<KuduClient> client; /// ... // open/initialize the client /// shared_ptr<KuduSession> session(client->NewSession()); /// ... // set Kudu session properties /// shared_ptr<KuduTable> table; /// ... // open the table /// unique_ptr<KuduInsert> insert_op(table->NewInsert()); /// ... // populate new insert operation with data /// RETURN_NOT_OK(session->Apply(insert_op.release())); /// RETURN_NOT_OK(session->Flush()); /// uint64_t snapshot_timestamp = client->GetLatestObservedTimestamp() + 1; /// KuduScanner scanner(table.get()); /// RETURN_NOT_OK(scanner.SetSnapshotRaw(snapshot_timestamp)); /// RETURN_NOT_OK(scanner.SetSelection(KuduClient::LEADER_ONLY)); /// RETURN_NOT_OK(scanner.SetReadMode(KuduScanner::READ_AT_SNAPSHOT)); /// RETURN_NOT_OK(scanner.Open()); /// ... // retrieve scanned rows /// @endcode -- To view, visit http://gerrit.cloudera.org:8080/12689 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51b01ae76cd22407df9097b56629ac7262ec2964 Gerrit-Change-Number: 12689 Gerrit-PatchSet: 12 Gerrit-Owner: Grant Henke <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Grant Henke <[email protected]> Gerrit-Reviewer: Greg Solovyev <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Comment-Date: Tue, 19 Mar 2019 04:03:06 +0000 Gerrit-HasComments: Yes
