hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [8/9] hbase git commit: HBASE-16090 ResultScanner is not closed in SyncTable#finishRemainingHashRanges()
Date Mon, 27 Jun 2016 01:55:44 GMT
HBASE-16090 ResultScanner is not closed in SyncTable#finishRemainingHashRanges()


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

Branch: refs/heads/0.98
Commit: 099b3da9e0b8dd023d0ec5933a901ff9bad6d267
Parents: 9cdf8c3
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Jun 23 07:29:34 2016 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Fri Jun 24 11:24:57 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/mapreduce/SyncTable.java   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/099b3da9/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
index 0c8f185..08ad1b0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/SyncTable.java
@@ -653,9 +653,16 @@ public class SyncTable extends Configured implements Tool {
             scan.setStopRow(nextSourceKey.copyBytes());
           }
           
-          ResultScanner targetScanner = targetTable.getScanner(scan);
-          for (Result row : targetScanner) {
-            targetHasher.hashResult(row);          
+          ResultScanner targetScanner = null;
+          try {
+            targetScanner = targetTable.getScanner(scan);
+            for (Result row : targetScanner) {
+              targetHasher.hashResult(row);
+            }
+          } finally {
+            if (targetScanner != null) {
+              targetScanner.close();
+            }
           }
         } // else current batch ends exactly at split end row
 


Mime
View raw message