Repository: phoenix
Updated Branches:
  refs/heads/4.2 225530326 -> 4211c1aaf


PHOENIX-1551 Upgrading from Phoenix 4.0.x to 4.2.2 and throw can't find 
SYSTEM.STATS


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/4211c1aa
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/4211c1aa
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/4211c1aa

Branch: refs/heads/4.2
Commit: 4211c1aaf2e6886407d13bfa0470206fa0546be4
Parents: 2255303
Author: Jeffrey Zhong <[email protected]>
Authored: Mon Jan 12 14:12:52 2015 -0800
Committer: Jeffrey Zhong <[email protected]>
Committed: Mon Jan 12 15:08:38 2015 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/util/ServerUtil.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/4211c1aa/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
index 7205faa..0998e72 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
@@ -142,13 +142,22 @@ public class ServerUtil {
      * This code works around HBASE-11837 which causes HTableInterfaces 
retrieved from
      * RegionCoprocessorEnvironment to not read local data.
      */
-    private static HTableInterface 
getTableFromSingletonPool(RegionCoprocessorEnvironment env, byte[] tableName) {
+    private static HTableInterface 
getTableFromSingletonPool(RegionCoprocessorEnvironment env, byte[] tableName) 
throws IOException {
         // It's ok to not ever do a pool.close() as we're storing a single
         // table only. The HTablePool holds no other resources that this table
         // which will be closed itself when it's no longer needed.
         @SuppressWarnings("resource")
         HTablePool pool = new HTablePool(env.getConfiguration(),1);
-        return pool.getTable(tableName);
+        try {
+            return pool.getTable(tableName);
+        } catch (RuntimeException t) {
+            // handle cases that an IOE is wrapped inside a RuntimeException 
like HTableInterface#createHTableInterface
+            if(t.getCause() instanceof IOException) {
+                throw (IOException)t.getCause();
+            } else {
+                throw t;
+            }
+        }
     }
     
     public static HTableInterface getHTableForCoprocessorScan 
(RegionCoprocessorEnvironment env, HTableInterface writerTable) throws 
IOException {

Reply via email to