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-14788 Splitting a region does not support the hbase.rs.evictblocksonclose config when closing source region
Date Wed, 11 Nov 2015 02:39:56 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 f782cab42 -> 37815cac9


HBASE-14788 Splitting a region does not support the hbase.rs.evictblocksonclose config when
closing source region


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

Branch: refs/heads/branch-1
Commit: 37815cac9ef2f1a5e1465eb156102b19966433ae
Parents: f782cab
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Nov 10 18:38:32 2015 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Nov 10 18:38:32 2015 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/regionserver/HRegionFileSystem.java    |  2 +-
 .../org/apache/hadoop/hbase/regionserver/HStore.java    | 12 +++++++++---
 .../org/apache/hadoop/hbase/regionserver/StoreFile.java | 12 ++++++++++--
 3 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/37815cac/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
index 584dc41..397ae7b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java
@@ -608,7 +608,7 @@ public class HRegionFileSystem {
           }
         }
       } finally {
-        f.closeReader(true);
+        f.closeReader(f.getCacheConf() != null ? f.getCacheConf().shouldEvictOnClose() :
true);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/37815cac/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
index 083b16d..a19407a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
@@ -550,9 +550,11 @@ public class HStore implements Store {
     }
     if (ioe != null) {
       // close StoreFile readers
+      boolean evictOnClose = 
+          cacheConf != null? cacheConf.shouldEvictOnClose(): true; 
       for (StoreFile file : results) {
         try {
-          if (file != null) file.closeReader(true);
+          if (file != null) file.closeReader(evictOnClose);
         } catch (IOException e) {
           LOG.warn(e.getMessage());
         }
@@ -1224,10 +1226,12 @@ public class HStore implements Store {
       if (!this.conf.getBoolean("hbase.hstore.compaction.complete", true)) {
         LOG.warn("hbase.hstore.compaction.complete is set to false");
         sfs = new ArrayList<StoreFile>(newFiles.size());
+        final boolean evictOnClose =
+            cacheConf != null? cacheConf.shouldEvictOnClose(): true;
         for (Path newFile : newFiles) {
           // Create storefile around what we wrote with a reader on it.
           StoreFile sf = createStoreFileAndReader(newFile);
-          sf.closeReader(true);
+          sf.closeReader(evictOnClose);
           sfs.add(sf);
         }
         return sfs;
@@ -1777,8 +1781,10 @@ public class HStore implements Store {
 
       // let the archive util decide if we should archive or delete the files
       LOG.debug("Removing store files after compaction...");
+      boolean evictOnClose = 
+          cacheConf != null? cacheConf.shouldEvictOnClose(): true; 
       for (StoreFile compactedFile : compactedFiles) {
-        compactedFile.closeReader(true);
+        compactedFile.closeReader(evictOnClose);
       }
       if (removeFiles) {
         this.fs.removeStoreFiles(this.getColumnFamilyName(), compactedFiles);

http://git-wip-us.apache.org/repos/asf/hbase/blob/37815cac/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 fe80aa4..4f90592 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
@@ -133,6 +133,10 @@ public class StoreFile {
 
   private KVComparator comparator;
 
+  CacheConfig getCacheConf() {
+    return cacheConf;
+  }
+
   public byte[] getFirstKey() {
     return firstKey;
   }
@@ -499,7 +503,9 @@ public class StoreFile {
         this.reader = open(canUseDropBehind);
       } catch (IOException e) {
         try {
-          this.closeReader(true);
+          boolean evictOnClose =
+              cacheConf != null? cacheConf.shouldEvictOnClose(): true; 
+          this.closeReader(evictOnClose);
         } catch (IOException ee) {
         }
         throw e;
@@ -534,7 +540,9 @@ public class StoreFile {
    * @throws IOException
    */
   public void deleteReader() throws IOException {
-    closeReader(true);
+    boolean evictOnClose =
+        cacheConf != null? cacheConf.shouldEvictOnClose(): true; 
+    closeReader(evictOnClose);
     this.fs.delete(getPath(), true);
   }
 


Mime
View raw message