This is an automated email from the ASF dual-hosted git repository.
tdsilva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/master by this push:
new b4d2745 PHOENIX-5126 RegionScanner leak leading to store files not
getting cleared
b4d2745 is described below
commit b4d27456a271054fb7e56e61b53aa78a222b31f4
Author: Abhishek Singh Chouhan <[email protected]>
AuthorDate: Thu Feb 7 13:51:15 2019 -0800
PHOENIX-5126 RegionScanner leak leading to store files not getting cleared
---
.../phoenix/hbase/index/covered/data/LocalTable.java | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/LocalTable.java
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/LocalTable.java
index 85c54ce..402620f 100644
---
a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/LocalTable.java
+++
b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/covered/data/LocalTable.java
@@ -70,14 +70,15 @@ public class LocalTable implements LocalHBaseState {
s.setTimeRange(0,ts);
}
Region region = this.env.getRegion();
- RegionScanner scanner = region.getScanner(s);
- List<Cell> kvs = new ArrayList<Cell>(1);
- boolean more = scanner.next(kvs);
- assert !more : "Got more than one result when scanning" + " a single row
in the primary table!";
+ try (RegionScanner scanner = region.getScanner(s)) {
+ List<Cell> kvs = new ArrayList<Cell>(1);
+ boolean more = scanner.next(kvs);
+ assert !more : "Got more than one result when scanning"
+ + " a single row in the primary table!";
- Result r = Result.create(kvs);
- scanner.close();
- return r;
+ Result r = Result.create(kvs);
+ return r;
+ }
}
// Returns the smallest timestamp in the given cell lists.