HBASE-13199 ADDENDUM Some small improvements on canary tool (Shaohui Liu)

This commit is contained in:
Liu Shaohui 2015-03-20 15:22:14 -05:00 committed by Sean Busbey
parent 6d4460341e
commit f4eb7191be

View File

@ -153,14 +153,13 @@ public final class Canary implements Tool {
} catch (IOException e) { } catch (IOException e) {
LOG.debug("sniffRegion failed", e); LOG.debug("sniffRegion failed", e);
sink.publishReadFailure(region, e); sink.publishReadFailure(region, e);
return null;
} finally {
if (table != null) { if (table != null) {
try { try {
table.close(); table.close();
} catch (IOException e) { } catch (IOException ioe) {
} }
} }
return null;
} }
byte[] startKey = null; byte[] startKey = null;
@ -204,17 +203,15 @@ public final class Canary implements Tool {
if (rs != null) { if (rs != null) {
rs.close(); rs.close();
} }
if (table != null) {
try {
table.close();
} catch (IOException e) {
}
}
scan = null; scan = null;
get = null; get = null;
startKey = null; startKey = null;
} }
} }
try {
table.close();
} catch (IOException e) {
}
return null; return null;
} }
} }