Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 bd490eeb7 -> 5a4972f9c


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/5a4972f9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5a4972f9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5a4972f9

Branch: refs/heads/branch-1.2
Commit: 5a4972f9c2c68bb8ccf4641a29de2504462e4ac4
Parents: bd490ee
Author: Phil Yang <ud1...@gmail.com>
Authored: Thu Nov 17 11:51:42 2016 +0800
Committer: Phil Yang <yangzhe1...@apache.org>
Committed: Fri Dec 2 14:04:52 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/5a4972f9/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 f93b5a1..8d86e11 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
@@ -7254,7 +7254,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
                 // Make a union of the set of tags in the old and new KVs
@@ -7646,7 +7646,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/5a4972f9/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 7dbbdc4..4eaf94a 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
@@ -6403,7 +6403,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);
   }
 
@@ -6428,7 +6428,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