hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-17590 Drop cache hint should work on store file write path
Date Thu, 12 Oct 2017 09:42:50 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 06dd1cc13 -> 146f3851e


HBASE-17590 Drop cache hint should work on store file write path

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>


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

Branch: refs/heads/branch-1.2
Commit: 146f3851e9525ff68a716697528f1764ddb8c214
Parents: 06dd1cc
Author: Ashu Pachauri <ashu210890@gmail.com>
Authored: Thu Oct 12 17:36:23 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Thu Oct 12 17:40:01 2017 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/StoreFile.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/146f3851/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 46a64f2..750c29b 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
@@ -584,7 +584,7 @@ public class StoreFile {
     private Path filePath;
     private InetSocketAddress[] favoredNodes;
     private HFileContext fileContext;
-
+    private boolean shouldDropCacheBehind;
     public WriterBuilder(Configuration conf, CacheConfig cacheConf,
         FileSystem fs) {
       this.conf = conf;
@@ -651,8 +651,8 @@ 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;
     }
     /**
@@ -685,7 +685,7 @@ public class StoreFile {
         comparator = KeyValue.COMPARATOR;
       }
       return new Writer(fs, filePath,
-          conf, cacheConf, comparator, bloomType, maxKeyCount, favoredNodes, fileContext);
+          conf, cacheConf, comparator, bloomType, maxKeyCount, favoredNodes, fileContext,
shouldDropCacheBehind);
     }
   }
 
@@ -780,19 +780,21 @@ 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 {
       writer = HFile.getWriterFactory(conf, cacheConf)
           .withPath(fs, path)
           .withComparator(comparator)
           .withFavoredNodes(favoredNodes)
           .withFileContext(fileContext)
+          .withShouldDropCacheBehind(shouldDropCacheBehind)
           .create();
 
       this.kvComparator = comparator;


Mime
View raw message