HBASE-6247. [REST] HTablePool.putTable is deprecated
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1352348 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3ec92cc8b1
commit
9aca0a9450
|
@ -76,7 +76,7 @@ public class RegionsResource extends ResourceBase {
|
|||
try {
|
||||
return ((HTable)table).getRegionsInfo();
|
||||
} finally {
|
||||
pool.putTable(table);
|
||||
table.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public class RowResultGenerator extends ResultGenerator {
|
|||
// the log.
|
||||
LOG.warn(StringUtils.stringifyException(e));
|
||||
} finally {
|
||||
pool.putTable(table);
|
||||
table.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public class ScannerResultGenerator extends ResultGenerator {
|
|||
id = Long.toString(System.currentTimeMillis()) +
|
||||
Integer.toHexString(scanner.hashCode());
|
||||
} finally {
|
||||
pool.putTable(table);
|
||||
table.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class SchemaResource extends ResourceBase {
|
|||
try {
|
||||
return table.getTableDescriptor();
|
||||
} finally {
|
||||
pool.putTable(table);
|
||||
table.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue