hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject svn commit: r1545870 - /hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
Date Tue, 26 Nov 2013 22:28:47 GMT
Author: eclark
Date: Tue Nov 26 22:28:47 2013
New Revision: 1545870

URL: http://svn.apache.org/r1545870
Log:
HBASE-10036 Fix Potential Resource Leak in MetaReader

Modified:
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java?rev=1545870&r1=1545869&r2=1545870&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
(original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
Tue Nov 26 22:28:47 2013
@@ -533,8 +533,9 @@ public class MetaReader {
     }
     scan.addFamily(HConstants.CATALOG_FAMILY);
     HTable metaTable = getMetaHTable(catalogTracker);
-    ResultScanner scanner = metaTable.getScanner(scan);
+    ResultScanner scanner = null;
     try {
+      scanner = metaTable.getScanner(scan);
       Result data;
       while((data = scanner.next()) != null) {
         if (data.isEmpty()) continue;
@@ -542,7 +543,7 @@ public class MetaReader {
         if (!visitor.visit(data)) break;
       }
     } finally {
-      scanner.close();
+      if (scanner != null) scanner.close();
       metaTable.close();
     }
     return;



Mime
View raw message