diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java index b19a1d3c548..c5667a131a6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java @@ -76,7 +76,7 @@ public class RegionsResource extends ResourceBase { try { return ((HTable)table).getRegionsInfo(); } finally { - pool.putTable(table); + table.close(); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java index e32e2be6105..db4fa60a14e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java @@ -213,14 +213,9 @@ public class RowResource extends ResourceBase { throw new WebApplicationException(e, Response.Status.SERVICE_UNAVAILABLE); } finally { - if (table != null) { - try { - pool.putTable(table); - } catch (IOException ioe) { - throw new WebApplicationException(ioe, - Response.Status.SERVICE_UNAVAILABLE); - } - } + if (table != null) try { + table.close(); + } catch (IOException ioe) { } } } @@ -275,14 +270,9 @@ public class RowResource extends ResourceBase { throw new WebApplicationException(e, Response.Status.SERVICE_UNAVAILABLE); } finally { - if (table != null) { - try { - pool.putTable(table); - } catch (IOException ioe) { - throw new WebApplicationException(ioe, - Response.Status.SERVICE_UNAVAILABLE); - } - } + if (table != null) try { + table.close(); + } catch (IOException ioe) { } } } @@ -373,14 +363,9 @@ public class RowResource extends ResourceBase { throw new WebApplicationException(e, Response.Status.SERVICE_UNAVAILABLE); } finally { - if (table != null) { - try { - pool.putTable(table); - } catch (IOException ioe) { - throw new WebApplicationException(ioe, - Response.Status.SERVICE_UNAVAILABLE); - } - } + if (table != null) try { + table.close(); + } catch (IOException ioe) { } } return Response.ok().build(); } @@ -450,14 +435,9 @@ public class RowResource extends ResourceBase { } catch (IOException e) { throw new WebApplicationException(e, Response.Status.SERVICE_UNAVAILABLE); } finally { - try { - if(table != null){ - pool.putTable(table); - } - } catch (Exception ioe) { - throw new WebApplicationException(ioe, - Response.Status.SERVICE_UNAVAILABLE); - } + if (table != null) try { + table.close(); + } catch (IOException ioe) { } } } @@ -518,12 +498,9 @@ public class RowResource extends ResourceBase { } catch (IOException e) { throw new WebApplicationException(e, Response.Status.SERVICE_UNAVAILABLE); } finally { - try { - pool.putTable(table); - } catch (Exception ioe) { - throw new WebApplicationException(ioe, - Response.Status.SERVICE_UNAVAILABLE); - } + if (table != null) try { + table.close(); + } catch (IOException ioe) { } } } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java index 84891cf0508..3bed1b5b763 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java @@ -78,7 +78,7 @@ public class RowResultGenerator extends ResultGenerator { // the log. LOG.warn(StringUtils.stringifyException(e)); } finally { - pool.putTable(table); + table.close(); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java index 69ff1f6982d..24330c80ab4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java @@ -92,7 +92,7 @@ public class ScannerResultGenerator extends ResultGenerator { id = Long.toString(System.currentTimeMillis()) + Integer.toHexString(scanner.hashCode()); } finally { - pool.putTable(table); + table.close(); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java index cff967aac9d..49fbf389988 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java @@ -83,7 +83,7 @@ public class SchemaResource extends ResourceBase { try { return table.getTableDescriptor(); } finally { - pool.putTable(table); + table.close(); } }