hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1352349 - in /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest: RegionsResource.java RowResource.java RowResultGenerator.java ScannerResultGenerator.java SchemaResource.java
Date Wed, 20 Jun 2012 21:45:19 GMT
Author: apurtell
Date: Wed Jun 20 21:45:19 2012
New Revision: 1352349

URL: http://svn.apache.org/viewvc?rev=1352349&view=rev
Log:
HBASE-6247. [REST] HTablePool.putTable is deprecated

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java?rev=1352349&r1=1352348&r2=1352349&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java Wed
Jun 20 21:45:19 2012
@@ -74,7 +74,7 @@ public class RegionsResource extends Res
     try {
       return ((HTable)table).getRegionsInfo();
     } finally {
-      pool.putTable(table);
+      table.close();
     }
   }
 

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java?rev=1352349&r1=1352348&r2=1352349&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java Wed Jun
20 21:45:19 2012
@@ -211,14 +211,9 @@ public class RowResource extends Resourc
       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) { }
     }
   }
 
@@ -273,14 +268,9 @@ public class RowResource extends Resourc
       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) { }
     }
   }
 
@@ -371,14 +361,9 @@ public class RowResource extends Resourc
       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();
   }
@@ -448,14 +433,9 @@ public class RowResource extends Resourc
     } 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) { }
     }
   }
 
@@ -516,12 +496,9 @@ public class RowResource extends Resourc
     } 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) { }
     }
   }
 }

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java?rev=1352349&r1=1352348&r2=1352349&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
Wed Jun 20 21:45:19 2012
@@ -76,7 +76,7 @@ public class RowResultGenerator extends 
       // the log.
       LOG.warn(StringUtils.stringifyException(e));
     } finally {
-      pool.putTable(table);
+      table.close();
     }
   }
 

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java?rev=1352349&r1=1352348&r2=1352349&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java
(original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java
Wed Jun 20 21:45:19 2012
@@ -90,7 +90,7 @@ public class ScannerResultGenerator exte
       id = Long.toString(System.currentTimeMillis()) +
              Integer.toHexString(scanner.hashCode());
     } finally {
-      pool.putTable(table);
+      table.close();
     }
   }
 

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java?rev=1352349&r1=1352348&r2=1352349&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java Wed
Jun 20 21:45:19 2012
@@ -81,7 +81,7 @@ public class SchemaResource extends Reso
     try {
       return table.getTableDescriptor();
     } finally {
-      pool.putTable(table);
+      table.close();
     }
   }
 



Mime
View raw message