hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16090 ResultScanner is not closed in SyncTable#finishRemainingHashRanges()
Date Thu, 23 Jun 2016 14:29:41 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 339cb8174 -> 857ec2f44


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/857ec2f4
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/857ec2f4
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/857ec2f4

Branch: refs/heads/branch-1
Commit: 857ec2f4483b62425c5c809157924e2fcad0a97f
Parents: 339cb81
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Jun 23 07:29:34 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Jun 23 07:29:34 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/857ec2f4/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 7adf200..b19b482 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
@@ -654,9 +654,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