hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yangzhe1...@apache.org
Subject hbase git commit: HBASE-17112 Prevent setting timestamp of delta operations being same as previous value's
Date Sat, 04 Feb 2017 06:24:53 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 ac9bde699 -> 2320b1c04


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

Branch: refs/heads/branch-1.3
Commit: 2320b1c04dce9235323895e9810d3010a0322e8f
Parents: ac9bde6
Author: Phil Yang <ud1937@gmail.com>
Authored: Thu Nov 17 11:51:42 2016 +0800
Committer: Phil Yang <yangzhe1991@apache.org>
Committed: Sat Feb 4 14:22:58 2017 +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/2320b1c0/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 9a86abc..cc3fedd 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
@@ -7464,7 +7464,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
@@ -7866,7 +7866,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/2320b1c0/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 2b3a9b5..3c0e147 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
@@ -6458,7 +6458,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);
   }
 
@@ -6483,7 +6483,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);


Mime
View raw message