Repository: phoenix
Updated Branches:
  refs/heads/master 71832b59f -> ddcb591f3


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/ddcb591f
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ddcb591f
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ddcb591f

Branch: refs/heads/master
Commit: ddcb591f3ed3aa8e9d4ab1f7eda62052638647bc
Parents: 71832b5
Author: Jeffrey Zhong <[email protected]>
Authored: Mon Jan 12 14:12:52 2015 -0800
Committer: Jeffrey Zhong <[email protected]>
Committed: Mon Jan 12 15:12:16 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/ddcb591f/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