hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [06/50] [abbrv] hbase git commit: HBASE-18749 Apply the CF specific TimeRange from Scan to filter the segment scanner
Date Mon, 11 Sep 2017 07:42:33 GMT
HBASE-18749 Apply the CF specific TimeRange from Scan to filter the segment scanner


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

Branch: refs/heads/HBASE-18467
Commit: 2f14a054f8d6497dee4a65f0206f5bf522477ef9
Parents: f36fb11
Author: Chia-Ping Tsai <chia7712@gmail.com>
Authored: Tue Sep 5 22:37:38 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Wed Sep 6 19:40:51 2017 +0800

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/CompositeImmutableSegment.java | 8 ++++----
 .../apache/hadoop/hbase/regionserver/ImmutableSegment.java   | 5 ++---
 .../org/apache/hadoop/hbase/regionserver/MutableSegment.java | 6 +++---
 .../java/org/apache/hadoop/hbase/regionserver/Segment.java   | 4 ++--
 .../org/apache/hadoop/hbase/regionserver/SegmentScanner.java | 3 ++-
 5 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2f14a054/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompositeImmutableSegment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompositeImmutableSegment.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompositeImmutableSegment.java
index c73e5f5..0b07fe3 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompositeImmutableSegment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompositeImmutableSegment.java
@@ -18,12 +18,12 @@
  */
 package org.apache.hadoop.hbase.regionserver;
 
-import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
 import org.apache.commons.logging.Log;
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
-import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.TimeRange;
+import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -122,7 +122,7 @@ public class CompositeImmutableSegment extends ImmutableSegment {
   }
 
   @Override
-  public boolean shouldSeek(Scan scan, long oldestUnexpiredTS){
+  public boolean shouldSeek(TimeRange tr, long oldestUnexpiredTS){
     throw new IllegalStateException("Not supported by CompositeImmutableScanner");
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2f14a054/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java
index 9d53c7c..bca5fe8 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ImmutableSegment.java
@@ -22,7 +22,6 @@ package org.apache.hadoop.hbase.regionserver;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.util.ClassSize;
-import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.io.TimeRange;
 
 import java.util.ArrayList;
@@ -79,8 +78,8 @@ public abstract class ImmutableSegment extends Segment {
 
   /////////////////////  PUBLIC METHODS  /////////////////////
   @Override
-  public boolean shouldSeek(Scan scan, long oldestUnexpiredTS) {
-    return this.timeRange.includesTimeRange(scan.getTimeRange()) &&
+  public boolean shouldSeek(TimeRange tr, long oldestUnexpiredTS) {
+    return this.timeRange.includesTimeRange(tr) &&
         this.timeRange.getMax() >= oldestUnexpiredTS;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2f14a054/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
index 0ec250a..8c09930 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MutableSegment.java
@@ -27,7 +27,7 @@ import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.TimeRange;
 import org.apache.hadoop.hbase.util.ClassSize;
 
 import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;
@@ -113,8 +113,8 @@ public class MutableSegment extends Segment {
   }
 
   @Override
-  public boolean shouldSeek(Scan scan, long oldestUnexpiredTS) {
-    return (this.timeRangeTracker.includesTimeRange(scan.getTimeRange())
+  public boolean shouldSeek(TimeRange tr, long oldestUnexpiredTS) {
+    return (this.timeRangeTracker.includesTimeRange(tr)
         && (this.timeRangeTracker.getMax() >= oldestUnexpiredTS));
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2f14a054/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
index bb15285..39d1da7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Segment.java
@@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.io.TimeRange;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.ClassSize;
 
@@ -177,7 +177,7 @@ public abstract class Segment {
     return KeyValueUtil.length(cell);
   }
 
-  public abstract boolean shouldSeek(Scan scan, long oldestUnexpiredTS);
+  public abstract boolean shouldSeek(TimeRange tr, long oldestUnexpiredTS);
 
   public abstract long getMinTimestamp();
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/2f14a054/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java
index ffdf295..337b763 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java
@@ -280,7 +280,8 @@ public class SegmentScanner implements KeyValueScanner {
    */
   @Override
   public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) {
-    return getSegment().shouldSeek(scan,oldestUnexpiredTS);
+    return getSegment().shouldSeek(scan.getColumnFamilyTimeRange()
+            .getOrDefault(store.getColumnFamilyDescriptor().getName(), scan.getTimeRange()),
oldestUnexpiredTS);
   }
 
   @Override


Mime
View raw message