HBASE-19732 Replica regions does not return back the MSLAB chunks to pool

(Ram)
This commit is contained in:
Vasudevan 2018-01-15 22:15:01 +05:30
parent e014e5f8ef
commit f23fd7208b
2 changed files with 12 additions and 1 deletions

View File

@ -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);
}

View File

@ -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();
}
}
}
}