/** * Takes a series of bytes and tries to generate an RemoteProcedureException instance for it. * @param bytes * @return the ForeignExcpetion instance * @throws InvalidProtocolBufferException if there was deserialization problem this is thrown. */ public static RemoteProcedureException deserialize(byte[] bytes) throws IOException { return fromProto(ForeignExceptionMessage.parseFrom(bytes)); }
@Override public ReportProcedureDoneResponse reportProcedureDone(RpcController controller, ReportProcedureDoneRequest request) throws ServiceException { request.getResultList().forEach(result -> { if (result.getStatus() == RemoteProcedureResult.Status.SUCCESS) { master.remoteProcedureCompleted(result.getProcId()); } else { master.remoteProcedureFailed(result.getProcId(), RemoteProcedureException.fromProto(result.getError())); } }); return ReportProcedureDoneResponse.getDefaultInstance(); }
proc.getState() == ProcedureProtos.ProcedureState.ROLLEDBACK : "The procedure must be failed (waiting to rollback) or rolledback"; proc.setFailure(RemoteProcedureException.fromProto(proto.getException()));
/** * Takes a series of bytes and tries to generate an RemoteProcedureException instance for it. * @param bytes * @return the ForeignExcpetion instance * @throws InvalidProtocolBufferException if there was deserialization problem this is thrown. */ public static RemoteProcedureException deserialize(byte[] bytes) throws IOException { return fromProto(ForeignExceptionMessage.parseFrom(bytes)); }
/** * Takes a series of bytes and tries to generate an RemoteProcedureException instance for it. * @param bytes * @return the ForeignExcpetion instance * @throws InvalidProtocolBufferException if there was deserialization problem this is thrown. */ public static RemoteProcedureException deserialize(byte[] bytes) throws IOException { return fromProto(ForeignExceptionMessage.parseFrom(bytes)); }
/** * Takes a series of bytes and tries to generate an RemoteProcedureException instance for it. * @param bytes * @return the ForeignExcpetion instance * @throws InvalidProtocolBufferException if there was deserialization problem this is thrown. */ public static RemoteProcedureException deserialize(byte[] bytes) throws InvalidProtocolBufferException { return fromProto(ForeignExceptionMessage.parseFrom(bytes)); }
public static byte[] waitForProcedureToComplete(ProcedureExecutor<MasterProcedureEnv> procExec, final long procId) throws IOException { while (!procExec.isFinished(procId) && procExec.isRunning()) { // TODO: add a config to make it tunable // Dev Consideration: are we waiting forever, or we can set up some timeout value? Threads.sleepWithoutInterrupt(250); } ProcedureInfo result = procExec.getResult(procId); if (result != null) { if (result.isFailed()) { // If the procedure fails, we should always have an exception captured. Throw it. throw RemoteProcedureException.fromProto( result.getForeignExceptionMessage()).unwrapRemoteException(); } return result.getResult(); } else { if (procExec.isRunning()) { throw new IOException("Procedure " + procId + "not found"); } else { throw new IOException("The Master is Aborting"); } } }
proc.getState() == ProcedureState.ROLLEDBACK : "The procedure must be failed (waiting to rollback) or rolledback"; proc.setFailure(RemoteProcedureException.fromProto(proto.getException()));
proc.getState() == ProcedureProtos.ProcedureState.ROLLEDBACK : "The procedure must be failed (waiting to rollback) or rolledback"; proc.setFailure(RemoteProcedureException.fromProto(proto.getException()));
proc.getState() == ProcedureProtos.ProcedureState.ROLLEDBACK : "The procedure must be failed (waiting to rollback) or rolledback"; proc.setFailure(RemoteProcedureException.fromProto(proto.getException()));