hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1352348 - in /hbase/trunk/hbase-server/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:08 GMT
Author: apurtell
Date: Wed Jun 20 21:45:08 2012
New Revision: 1352348

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

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RegionsResource.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/ScannerResultGenerator.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/SchemaResource.java

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

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java?rev=1352348&r1=1352347&r2=1352348&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java Wed
Jun 20 21:45:08 2012
@@ -213,14 +213,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) { }
     }
   }
 
@@ -275,14 +270,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) { }
     }
   }
 
@@ -373,14 +363,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();
   }
@@ -450,14 +435,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) { }
     }
   }
 
@@ -518,12 +498,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/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java?rev=1352348&r1=1352347&r2=1352348&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResultGenerator.java
Wed Jun 20 21:45:08 2012
@@ -78,7 +78,7 @@ public class RowResultGenerator extends 
       // the log.
       LOG.warn(StringUtils.stringifyException(e));
     } finally {
-      pool.putTable(table);
+      table.close();
     }
   }
 

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

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



Mime
View raw message