Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 3b0319ab0 -> add0259f0


HBASE-17112 Prevent setting timestamp of delta operations being same as 
previous value's


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/add0259f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/add0259f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/add0259f

Branch: refs/heads/branch-1.1
Commit: add0259f0f216aa5f46df1041e8c22f9b2127e62
Parents: 3b0319a
Author: Phil Yang <ud1...@gmail.com>
Authored: Thu Nov 17 11:55:59 2016 +0800
Committer: Phil Yang <yangzhe1...@apache.org>
Committed: Fri Dec 2 14:09:14 2016 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/regionserver/HRegion.java  | 4 ++--
 .../java/org/apache/hadoop/hbase/regionserver/TestHRegion.java   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/add0259f/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index e600ae1..0babdc2 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -6974,7 +6974,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
               if (idx < results.size()
                   && CellUtil.matchingQualifier(results.get(idx), cell)) {
                 oldCell = results.get(idx);
-                long ts = Math.max(now, oldCell.getTimestamp());
+                long ts = Math.max(now, oldCell.getTimestamp() + 1);
 
                 // Process cell tags
                 List<Tag> tags = Tag.carryForwardTags(null, oldCell);
@@ -7307,7 +7307,7 @@ public class HRegion implements HeapSize, 
PropagatingConfigurationObserver, Regi
       long ts = now;
       if (idx < currentValues.size() && 
CellUtil.matchingQualifier(currentValues.get(idx), inc)) {
         currentValue = currentValues.get(idx);
-        ts = Math.max(now, currentValue.getTimestamp());
+        ts = Math.max(now, currentValue.getTimestamp() + 1);
         incrementAmount += getLongValue(currentValue);
         // Carry forward all tags
         tags = Tag.carryForwardTags(tags, currentValue);

http://git-wip-us.apache.org/repos/asf/hbase/blob/add0259f/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index ed26a6d..5608a96 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -6320,7 +6320,7 @@ public class TestHRegion {
     region.increment(inc);
     result = region.get(new Get(row));
     c = result.getColumnLatestCell(fam1, qual1);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(c.getTimestamp(), 11L);
     assertEquals(Bytes.toLong(c.getValueArray(), c.getValueOffset(), 
c.getValueLength()), 2L);
   }
 
@@ -6345,7 +6345,7 @@ public class TestHRegion {
     region.append(a);
     result = region.get(new Get(row));
     c = result.getColumnLatestCell(fam1, qual1);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(c.getTimestamp(), 11L);
 
     byte[] expected = new byte[qual1.length*2];
     System.arraycopy(qual1, 0, expected, 0, qual1.length);

Reply via email to