From cf5b0a427e1ad39dff858eb6ddde01a331872a46 Mon Sep 17 00:00:00 2001 From: cuijianwei Date: Sun, 10 Apr 2016 14:31:31 +0800 Subject: [PATCH] Incorrect javadoc for atomicity guarantee of Increment and Append --- .../org/apache/hadoop/hbase/client/Append.java | 7 +++---- .../org/apache/hadoop/hbase/client/Increment.java | 7 +++---- .../java/org/apache/hadoop/hbase/client/Table.java | 14 ++++++-------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java index 45f1e46..bfe8921 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Append.java @@ -35,10 +35,9 @@ import org.apache.hadoop.hbase.util.Bytes; /** * Performs Append operations on a single row. *

- * Note that this operation does not appear atomic to readers. Appends are done - * under a single row lock, so write operations to a row are synchronized, but - * readers do not take row locks so get and scan operations can see this - * operation partially completed. + * This operation ensures atomicty to readers. Appends are done + * under a single row lock, so write operations to a row are synchronized, and + * readers are guaranteed to see this operation fully completed. *

* To append to a set of columns of a row, instantiate an Append object with the * row to append to. At least one column to append must be specified using the diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java index 187c077..a31ade1 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Increment.java @@ -39,10 +39,9 @@ import org.apache.hadoop.hbase.util.ClassSize; /** * Used to perform Increment operations on a single row. *

- * This operation does not appear atomic to readers. Increments are done - * under a single row lock, so write operations to a row are synchronized, but - * readers do not take row locks so get and scan operations can see this - * operation partially completed. + * This operation ensures atomicity to readers. Increments are done + * under a single row lock, so write operations to a row are synchronized, and + * readers are guaranteed to see this operation fully completed. *

* To increment columns of a row, instantiate an Increment object with the row * to increment. At least one column to increment must be specified using the diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java index 3e9db00..496c111 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Table.java @@ -312,10 +312,9 @@ public interface Table extends Closeable { /** * Appends values to one or more columns within a single row. *

- * This operation does not appear atomic to readers. Appends are done - * under a single row lock, so write operations to a row are synchronized, but - * readers do not take row locks so get and scan operations can see this - * operation partially completed. + * This operation guaranteed atomicity to readers. Appends are done + * under a single row lock, so write operations to a row are synchronized, and + * readers are guaranteed to see this operation fully completed. * * @param append object that specifies the columns and amounts to be used * for the increment operations @@ -327,10 +326,9 @@ public interface Table extends Closeable { /** * Increments one or more columns within a single row. *

- * This operation does not appear atomic to readers. Increments are done - * under a single row lock, so write operations to a row are synchronized, but - * readers do not take row locks so get and scan operations can see this - * operation partially completed. + * This operation ensures atomicity to readers. Increments are done + * under a single row lock, so write operations to a row are synchronized, and + * readers are guaranteed to see this operation fully completed. * * @param increment object that specifies the columns and amounts to be used * for the increment operations -- 1.7.9.5