kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] 01/02: update outdated comments for Read-your-writes scan
Date Wed, 20 Mar 2019 19:08:53 GMT
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 2be6869ddfd8b0f4c22c25eab5d293b2e33f108f
Author: Hao Hao <hao.hao@cloudera.com>
AuthorDate: Fri Mar 15 13:51:06 2019 -0700

    update outdated comments for Read-your-writes scan
    
    Change-Id: Ia5eaa8c64edcb35a6936d8699396d45ef8457dea
    Reviewed-on: http://gerrit.cloudera.org:8080/12768
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
---
 src/kudu/client/client.h | 38 +++-----------------------------------
 1 file changed, 3 insertions(+), 35 deletions(-)

diff --git a/src/kudu/client/client.h b/src/kudu/client/client.h
index 780967c..a5ad313 100644
--- a/src/kudu/client/client.h
+++ b/src/kudu/client/client.h
@@ -497,38 +497,9 @@ class KUDU_EXPORT KuduClient : public sp::enable_shared_from_this<KuduClient>
{
 
   /// Get the highest HybridTime timestamp observed by the client.
   ///
-  /// The latest observed timestamp can be used to start a snapshot scan on a
-  /// table which is guaranteed to contain all data written or previously read
-  /// by this client. See KuduScanner for more details on timestamps.
-  ///
-  /// 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
-  /// There are currently races in which, in rare occasions, Read-Your-Writes
-  /// consistency might not hold even in this case. These are being
-  /// taken care of as part of
-  /// <a href="https://issues.apache.org/jira/browse/KUDU-430">KUDU-430</a>
+  /// This is useful when retrieving timestamp from one client and
+  /// forwarding it to another to enforce external consistency when
+  /// using KuduSession::CLIENT_PROPAGATED external consistency mode.
   ///
   /// @note This method is experimental and will either disappear or
   ///   change in a future release.
@@ -2158,9 +2129,6 @@ class KUDU_EXPORT KuduScanner {
 
   /// Set snapshot timestamp for scans in @c READ_AT_SNAPSHOT mode (raw).
   ///
-  /// See KuduClient::GetLatestObservedTimestamp() for details on how to
-  /// use this method to achieve Read-Your-Writes behavior.
-  ///
   /// @note This method is experimental and will either disappear or
   ///   change in a future release.
   ///


Mime
View raw message