This is an automated email from the ASF dual-hosted git repository.
tdsilva pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
new fc3bf8e PHOENIX-5126 RegionScanner leak leading to store files not
getting cleared
fc3bf8e is described below
commit fc3bf8ea29b6a0e13ec1a974e0e520b94fbae3bb
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.