From 93e200d52b29d35ad5a98eed9eea05783960f6b2 Mon Sep 17 00:00:00 2001 From: ramkrishna Date: Wed, 20 Jan 2016 11:42:13 +0530 Subject: [PATCH] HBASE-15101 Leaked References to StoreFile.Reader after HBASE-13082 (Deepankar) --- .../org/apache/hadoop/hbase/regionserver/StoreScanner.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java index 3049608ce64..9ab68e4f586 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java @@ -407,6 +407,8 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner if (kvs.shouldUseScanner(scan, store, expiredTimestampCutoff)) { scanners.add(kvs); + } else { + kvs.close(); } } return scanners; @@ -549,6 +551,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner if (storeLimit > -1 && this.countPerRow > (storeLimit + storeOffset)) { // do what SEEK_NEXT_ROW does. if (!matcher.moreRowsMayExistAfter(cell)) { + close(false);// Do all cleanup except heap.close() return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues(); } matcher.curCell = null; @@ -577,6 +580,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner if (qcode == ScanQueryMatcher.MatchCode.INCLUDE_AND_SEEK_NEXT_ROW) { if (!matcher.moreRowsMayExistAfter(cell)) { + close(false);// Do all cleanup except heap.close() return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues(); } matcher.curCell = null; @@ -607,6 +611,7 @@ public class StoreScanner extends NonReversedNonLazyKeyValueScanner // This is just a relatively simple end of scan fix, to short-cut end // us if there is an endKey in the scan. if (!matcher.moreRowsMayExistAfter(cell)) { + close(false);// Do all cleanup except heap.close() return scannerContext.setScannerState(NextState.NO_MORE_VALUES).hasMoreValues(); } matcher.curCell = null;