hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject [3/5] hbase git commit: HBASE-13789 ForeignException should not be sent to the client
Date Fri, 29 May 2015 19:08:14 GMT
HBASE-13789 ForeignException should not be sent to the client


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/02af4b06
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/02af4b06
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/02af4b06

Branch: refs/heads/branch-1
Commit: 02af4b066f871894b057d26b1ca2b5f031d18735
Parents: 32f4a6a
Author: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Authored: Fri May 29 19:32:42 2015 +0100
Committer: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
Committed: Fri May 29 12:02:32 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hbase/master/MasterRpcServices.java       | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/02af4b06/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
index 7a30bac..b2e8306 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
@@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.UnknownRegionException;
 import org.apache.hadoop.hbase.MetaTableAccessor;
+import org.apache.hadoop.hbase.errorhandling.ForeignException;
 import org.apache.hadoop.hbase.exceptions.MergeRegionException;
 import org.apache.hadoop.hbase.exceptions.UnknownProtocolException;
 import org.apache.hadoop.hbase.ipc.QosPriority;
@@ -667,6 +668,8 @@ public class MasterRpcServices extends RSRpcServices
       long waitTime = SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME;
       return ExecProcedureResponse.newBuilder().setExpectedTimeout(
         waitTime).build();
+    } catch (ForeignException e) {
+      throw new ServiceException(e.getCause());
     } catch (IOException e) {
       throw new ServiceException(e);
     }
@@ -900,6 +903,8 @@ public class MasterRpcServices extends RSRpcServices
       boolean done = mpm.isProcedureDone(desc);
       builder.setDone(done);
       return builder.build();
+    } catch (ForeignException e) {
+      throw new ServiceException(e.getCause());
     } catch (IOException e) {
       throw new ServiceException(e);
     }
@@ -925,6 +930,8 @@ public class MasterRpcServices extends RSRpcServices
       boolean done = master.snapshotManager.isRestoreDone(snapshot);
       builder.setDone(done);
       return builder.build();
+    } catch (ForeignException e) {
+      throw new ServiceException(e.getCause());
     } catch (IOException e) {
       throw new ServiceException(e);
     }
@@ -948,6 +955,8 @@ public class MasterRpcServices extends RSRpcServices
       boolean done = master.snapshotManager.isSnapshotDone(request.getSnapshot());
       builder.setDone(done);
       return builder.build();
+    } catch (ForeignException e) {
+      throw new ServiceException(e.getCause());
     } catch (IOException e) {
       throw new ServiceException(e);
     }
@@ -1160,6 +1169,8 @@ public class MasterRpcServices extends RSRpcServices
       SnapshotDescription reqSnapshot = request.getSnapshot();
       master.snapshotManager.restoreSnapshot(reqSnapshot);
       return RestoreSnapshotResponse.newBuilder().build();
+    } catch (ForeignException e) {
+      throw new ServiceException(e.getCause());
     } catch (IOException e) {
       throw new ServiceException(e);
     }
@@ -1219,6 +1230,8 @@ public class MasterRpcServices extends RSRpcServices
       long waitTime = SnapshotDescriptionUtils.getMaxMasterTimeout(master.getConfiguration(),
         snapshot.getType(), SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME);
       return SnapshotResponse.newBuilder().setExpectedTimeout(waitTime).build();
+    } catch (ForeignException e) {
+      throw new ServiceException(e.getCause());
     } catch (IOException e) {
       throw new ServiceException(e);
     }
@@ -1341,7 +1354,7 @@ public class MasterRpcServices extends RSRpcServices
     response.setEnabled(master.isBalancerOn());
     return response.build();
   }
-  
+
   @Override
   public SetQuotaResponse setQuota(RpcController c, SetQuotaRequest req) throws ServiceException
{
     try {


Mime
View raw message