HBASE-13789 ForeignException should not be sent to the client
This commit is contained in:
parent
32f4a6ad8f
commit
02af4b066f
|
@ -37,6 +37,7 @@ import org.apache.hadoop.hbase.ServerName;
|
||||||
import org.apache.hadoop.hbase.TableName;
|
import org.apache.hadoop.hbase.TableName;
|
||||||
import org.apache.hadoop.hbase.UnknownRegionException;
|
import org.apache.hadoop.hbase.UnknownRegionException;
|
||||||
import org.apache.hadoop.hbase.MetaTableAccessor;
|
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.MergeRegionException;
|
||||||
import org.apache.hadoop.hbase.exceptions.UnknownProtocolException;
|
import org.apache.hadoop.hbase.exceptions.UnknownProtocolException;
|
||||||
import org.apache.hadoop.hbase.ipc.QosPriority;
|
import org.apache.hadoop.hbase.ipc.QosPriority;
|
||||||
|
@ -667,6 +668,8 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
long waitTime = SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME;
|
long waitTime = SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME;
|
||||||
return ExecProcedureResponse.newBuilder().setExpectedTimeout(
|
return ExecProcedureResponse.newBuilder().setExpectedTimeout(
|
||||||
waitTime).build();
|
waitTime).build();
|
||||||
|
} catch (ForeignException e) {
|
||||||
|
throw new ServiceException(e.getCause());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
@ -900,6 +903,8 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
boolean done = mpm.isProcedureDone(desc);
|
boolean done = mpm.isProcedureDone(desc);
|
||||||
builder.setDone(done);
|
builder.setDone(done);
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
} catch (ForeignException e) {
|
||||||
|
throw new ServiceException(e.getCause());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
@ -925,6 +930,8 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
boolean done = master.snapshotManager.isRestoreDone(snapshot);
|
boolean done = master.snapshotManager.isRestoreDone(snapshot);
|
||||||
builder.setDone(done);
|
builder.setDone(done);
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
} catch (ForeignException e) {
|
||||||
|
throw new ServiceException(e.getCause());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
@ -948,6 +955,8 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
boolean done = master.snapshotManager.isSnapshotDone(request.getSnapshot());
|
boolean done = master.snapshotManager.isSnapshotDone(request.getSnapshot());
|
||||||
builder.setDone(done);
|
builder.setDone(done);
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
} catch (ForeignException e) {
|
||||||
|
throw new ServiceException(e.getCause());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
@ -1160,6 +1169,8 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
SnapshotDescription reqSnapshot = request.getSnapshot();
|
SnapshotDescription reqSnapshot = request.getSnapshot();
|
||||||
master.snapshotManager.restoreSnapshot(reqSnapshot);
|
master.snapshotManager.restoreSnapshot(reqSnapshot);
|
||||||
return RestoreSnapshotResponse.newBuilder().build();
|
return RestoreSnapshotResponse.newBuilder().build();
|
||||||
|
} catch (ForeignException e) {
|
||||||
|
throw new ServiceException(e.getCause());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
@ -1219,6 +1230,8 @@ public class MasterRpcServices extends RSRpcServices
|
||||||
long waitTime = SnapshotDescriptionUtils.getMaxMasterTimeout(master.getConfiguration(),
|
long waitTime = SnapshotDescriptionUtils.getMaxMasterTimeout(master.getConfiguration(),
|
||||||
snapshot.getType(), SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME);
|
snapshot.getType(), SnapshotDescriptionUtils.DEFAULT_MAX_WAIT_TIME);
|
||||||
return SnapshotResponse.newBuilder().setExpectedTimeout(waitTime).build();
|
return SnapshotResponse.newBuilder().setExpectedTimeout(waitTime).build();
|
||||||
|
} catch (ForeignException e) {
|
||||||
|
throw new ServiceException(e.getCause());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue