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-13810 Table is left unclosed in VerifyReplication#Verifier
Date Sat, 30 May 2015 00:44:18 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 3b2c1a0f9 -> 6c0a4b425


HBASE-13810 Table is left unclosed in VerifyReplication#Verifier


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

Branch: refs/heads/branch-1.1
Commit: 6c0a4b42595d622e9e49e0a91639c2e76355bd67
Parents: 3b2c1a0
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri May 29 17:44:16 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri May 29 17:44:16 2015 -0700

----------------------------------------------------------------------
 .../hbase/mapreduce/replication/VerifyReplication.java  | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/6c0a4b42/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
index f94dac9..c91e7b0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplication.java
@@ -87,6 +87,7 @@ public class VerifyReplication extends Configured implements Tool {
 
     private ResultScanner replicatedScanner;
     private Result currentCompareRowInPeerTable;
+    private Table replicatedTable;
 
     /**
      * Map method that compares every scanned row with the equivalent from
@@ -127,8 +128,7 @@ public class VerifyReplication extends Configured implements Tool {
             ZKUtil.applyClusterKeyToConf(peerConf, zkClusterKey);
 
             TableName tableName = TableName.valueOf(conf.get(NAME + ".tableName"));
-            // TODO: THis HTable doesn't get closed.  Fix!
-            Table replicatedTable = new HTable(peerConf, tableName);
+            replicatedTable = new HTable(peerConf, tableName);
             scan.setStartRow(value.getRow());
             scan.setStopRow(tableSplit.getEndRow());
             replicatedScanner = replicatedTable.getScanner(scan);
@@ -189,6 +189,14 @@ public class VerifyReplication extends Configured implements Tool {
           replicatedScanner = null;
         }
       }
+      if (replicatedTable != null) {
+        TableName tableName = replicatedTable.getName();
+        try {
+          replicatedTable.close();
+        } catch (IOException ioe) {
+          LOG.warn("Exception closing " + tableName, ioe);
+        }
+      }
     }
   }
 


Mime
View raw message