hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject hbase git commit: HBASE-17590 Drop cache hint should work on store file write path (Ashu Pachauri)
Date Wed, 22 Feb 2017 21:43:34 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 de3177caa -> e5dfbe64f


HBASE-17590 Drop cache hint should work on store file write path (Ashu Pachauri)

Signed-off-by: Gary Helmling <garyh@apache.org>


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

Branch: refs/heads/branch-1.3
Commit: e5dfbe64f45cc931059e8a1d814d8b72d1dbf791
Parents: de3177c
Author: Ashu Pachauri <ashu210890@gmail.com>
Authored: Wed Feb 8 11:29:33 2017 -0800
Committer: Gary Helmling <garyh@apache.org>
Committed: Wed Feb 22 13:38:09 2017 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/StoreFile.java    | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e5dfbe64/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
index 6e66756..7a9dbe1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
@@ -618,6 +618,7 @@ public class StoreFile {
     private InetSocketAddress[] favoredNodes;
     private HFileContext fileContext;
     private TimeRangeTracker trt;
+    private boolean shouldDropCacheBehind;
 
     public WriterBuilder(Configuration conf, CacheConfig cacheConf,
         FileSystem fs) {
@@ -696,10 +697,11 @@ public class StoreFile {
       return this;
     }
 
-    public WriterBuilder withShouldDropCacheBehind(boolean shouldDropCacheBehind/*NOT USED!!*/)
{
-      // TODO: HAS NO EFFECT!!! FIX!!
+    public WriterBuilder withShouldDropCacheBehind(boolean shouldDropCacheBehind) {
+      this.shouldDropCacheBehind = shouldDropCacheBehind;
       return this;
     }
+
     /**
      * Create a store file writer. Client is responsible for closing file when
      * done. If metadata, add BEFORE closing using
@@ -730,7 +732,8 @@ public class StoreFile {
         comparator = KeyValue.COMPARATOR;
       }
       return new Writer(fs, filePath,
-          conf, cacheConf, comparator, bloomType, maxKeyCount, favoredNodes, fileContext,
trt);
+          conf, cacheConf, comparator, bloomType, maxKeyCount, favoredNodes, fileContext,
+          shouldDropCacheBehind, trt);
     }
   }
 
@@ -829,16 +832,17 @@ public class StoreFile {
      *        for Bloom filter size in {@link HFile} format version 1.
      * @param favoredNodes
      * @param fileContext - The HFile context
+     * @param shouldDropCacheBehind Drop pages written to page cache after writing the store
file.
      * @throws IOException problem writing to FS
      */
     private Writer(FileSystem fs, Path path,
         final Configuration conf,
         CacheConfig cacheConf,
         final KVComparator comparator, BloomType bloomType, long maxKeys,
-        InetSocketAddress[] favoredNodes, HFileContext fileContext)
+        InetSocketAddress[] favoredNodes, HFileContext fileContext, boolean shouldDropCacheBehind)
             throws IOException {
       this(fs, path, conf, cacheConf, comparator, bloomType, maxKeys, favoredNodes, fileContext,
-          null);
+          shouldDropCacheBehind, null);
     }
 
     /**
@@ -852,7 +856,8 @@ public class StoreFile {
      *        for Bloom filter size in {@link HFile} format version 1.
      * @param favoredNodes
      * @param fileContext - The HFile context
-   * @param trt Ready-made timetracker to use.
+     * @param shouldDropCacheBehind Drop pages written to page cache after writing the store
file.
+     * @param trt Ready-made timetracker to use.
      * @throws IOException problem writing to FS
      */
     private Writer(FileSystem fs, Path path,
@@ -860,7 +865,7 @@ public class StoreFile {
         CacheConfig cacheConf,
         final KVComparator comparator, BloomType bloomType, long maxKeys,
         InetSocketAddress[] favoredNodes, HFileContext fileContext,
-        final TimeRangeTracker trt)
+        boolean shouldDropCacheBehind, final TimeRangeTracker trt)
             throws IOException {
       // If passed a TimeRangeTracker, use it. Set timeRangeTrackerSet so we don't destroy
it.
       // TODO: put the state of the TRT on the TRT; i.e. make a read-only version (TimeRange)
when
@@ -872,6 +877,7 @@ public class StoreFile {
           .withComparator(comparator)
           .withFavoredNodes(favoredNodes)
           .withFileContext(fileContext)
+          .withShouldDropCacheBehind(shouldDropCacheBehind)
           .create();
 
       this.kvComparator = comparator;


Mime
View raw message