hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1546434 - in /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase: filter/TimestampsFilter.java regionserver/HRegionServer.java
Date Thu, 28 Nov 2013 18:13:37 GMT
Author: liyin
Date: Thu Nov 28 18:13:36 2013
New Revision: 1546434

URL: http://svn.apache.org/r1546434
Log:
[master] Add a conf setting to avoid perf regression caused by avoiding SEEK_NEXT_USING_HINT

Author: aaiyer

Summary: Add a conf setting to avoid perf regression caused by avoiding SEEK_NEXT_USING_HINT

Test Plan: push to tsh052 and see the iops go down

Reviewers: rshroff, fan

Reviewed By: fan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D1077065

Blame Revision: https://phabricator.fb.com/D984895

Task ID: 2708958

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java?rev=1546434&r1=1546433&r2=1546434&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/filter/TimestampsFilter.java
Thu Nov 28 18:13:36 2013
@@ -8,6 +8,8 @@ import java.util.ArrayList;
 import java.util.TreeSet;
 
 import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.regionserver.HRegionServer;
+
 import com.google.common.base.Preconditions;
 
 /**
@@ -73,10 +75,12 @@ public class TimestampsFilter extends Fi
       // to be lesser than all of the other values.
       return ReturnCode.NEXT_COL;
     }
-    // Skip current KeyValue. Cannot use ReturnCode.SEEK_NEXT_USING_HINT
-    // until the problem of missing delete marker in getNextKeyHint(KeyValue)
-    // is resolved.
-    return ReturnCode.SKIP;
+    // Skip current KeyValue.
+    // It may be incorrect to return ReturnCode.SEEK_NEXT_USING_HINT, as it could
+    // skip past some DeleteColumn KV's to cause incorrect behavior. However, not
+    // using ReturnCode.SEEK_NEXT_USING_HINT has a perf penalty. So, we let the
+    // configuration specify decide what the application cares about.
+    return (HRegionServer.useSeekNextUsingHint? ReturnCode.SEEK_NEXT_USING_HINT: ReturnCode.SKIP);
   }
 
   public TreeSet<Long> getTimestamps() {

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1546434&r1=1546433&r2=1546434&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Thu Nov 28 18:13:36 2013
@@ -110,6 +110,7 @@ import org.apache.hadoop.hbase.client.Se
 import org.apache.hadoop.hbase.client.ServerConnectionManager;
 import org.apache.hadoop.hbase.conf.ConfigurationManager;
 import org.apache.hadoop.hbase.io.hfile.CacheConfig;
+import org.apache.hadoop.hbase.filter.TimestampsFilter;
 import org.apache.hadoop.hbase.io.hfile.L2BucketCache;
 import org.apache.hadoop.hbase.io.hfile.LruBlockCache;
 import org.apache.hadoop.hbase.io.hfile.LruBlockCache.CacheStats;
@@ -378,6 +379,7 @@ public class HRegionServer implements HR
   private int numRowRequests = 0;
 
   public static boolean runMetrics = true;
+  public static boolean useSeekNextUsingHint;
 
   // This object lets classes register themselves to get notified on
   // Configuration changes.
@@ -444,6 +446,9 @@ public class HRegionServer implements HR
     enableServerSideProfilingForAllCalls.set(conf.getBoolean(
         HConstants.HREGIONSERVER_ENABLE_SERVERSIDE_PROFILING, false));
 
+    HRegionServer.useSeekNextUsingHint =
+        conf.getBoolean("hbase.regionserver.scan.timestampfilter.allow_seek_next_using_hint",
true);
+
     reinitialize();
     SchemaMetrics.configureGlobally(conf);
     cacheConfig = new CacheConfig(conf);
@@ -3753,6 +3758,9 @@ public class HRegionServer implements HR
             " with new favored nodes: " + favoredNodes);
         counter++;
       }
+
+    HRegionServer.useSeekNextUsingHint =
+        conf.getBoolean("hbase.regionserver.scan.timestampfilter.allow_seek_next_using_hint",
true);
     }
     return counter;
   }



Mime
View raw message