hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-17112 Prevent setting timestamp of delta operations the same as previous value's (Phil Yang)
Date Thu, 17 Nov 2016 17:04:46 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 d722b2aab -> c6f1b6e62


HBASE-17112 Prevent setting timestamp of delta operations the same as previous value's (Phil
Yang)


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

Branch: refs/heads/branch-1
Commit: c6f1b6e62456a02ffe367c1574946a10262d5a03
Parents: d722b2a
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Nov 17 09:04:39 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Nov 17 09:04:39 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/c6f1b6e6/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 4674b4d..4972fd3 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
@@ -7496,7 +7496,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
@@ -7906,7 +7906,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/c6f1b6e6/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 8916d1a..e1af83a 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
@@ -6544,7 +6544,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);
   }
 
@@ -6569,7 +6569,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