hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [03/31] hbase git commit: HBASE-19732 Replica regions does not return back the MSLAB chunks to pool (Ram)
Date Fri, 19 Jan 2018 13:24:37 GMT
HBASE-19732 Replica regions does not return back the MSLAB chunks to pool
(Ram)


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

Branch: refs/heads/HBASE-19064
Commit: d155a4e33d279bdf4b57b08ebc8220fe5d97f4cc
Parents: 3a66f15
Author: Vasudevan <ramkrishna.s.vasudevan@intel.com>
Authored: Mon Jan 15 22:15:01 2018 +0530
Committer: Vasudevan <ramkrishna.s.vasudevan@intel.com>
Committed: Mon Jan 15 22:20:27 2018 +0530

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/HStore.java    |  1 +
 .../hadoop/hbase/regionserver/MemStoreSnapshot.java     | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d155a4e3/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 2ccc8a0..01121dd 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
@@ -2283,6 +2283,7 @@ public class HStore implements Store, HeapSize, StoreConfigInformation,
Propagat
       long snapshotId = -1; // -1 means do not drop
       if (dropMemstoreSnapshot && snapshot != null) {
         snapshotId = snapshot.getId();
+        snapshot.close();
       }
       HStore.this.updateStorefiles(storeFiles, snapshotId);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/d155a4e3/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSnapshot.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSnapshot.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSnapshot.java
index 0d4e5f1..1a0317d 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSnapshot.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreSnapshot.java
@@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.regionserver;
 
 import org.apache.yetus.audience.InterfaceAudience;
 
+import java.io.Closeable;
 import java.util.List;
 /**
  * Holds details of the snapshot taken on a MemStore. Details include the snapshot's identifier,
@@ -26,7 +27,7 @@ import java.util.List;
  * all the cells and a scanner to read all cells in it.
  */
 @InterfaceAudience.Private
-public class MemStoreSnapshot {
+public class MemStoreSnapshot implements Closeable {
   private final long id;
   private final int cellsCount;
   private final long dataSize;
@@ -90,4 +91,13 @@ public class MemStoreSnapshot {
   public boolean isTagsPresent() {
     return this.tagsPresent;
   }
+
+  @Override
+  public void close() {
+    if (this.scanners != null) {
+      for (KeyValueScanner scanner : scanners) {
+        scanner.close();
+      }
+    }
+  }
 }


Mime
View raw message