protected synchronized void setFailure(final RemoteProcedureException exception) { this.exception = exception; if (!isFinished()) { setState(ProcedureState.FAILED); } }
/** * Called by the ProcedureExecutor to assign the ID to the newly created procedure. */ @VisibleForTesting protected void setProcId(long procId) { this.procId = procId; this.submittedTime = EnvironmentEdgeManager.currentTime(); setState(ProcedureState.RUNNABLE); }
/** * Try to set this procedure into RUNNABLE state. * Succeeds if all subprocedures/children are done. * @return True if we were able to move procedure to RUNNABLE state. */ synchronized boolean tryRunnable() { // Don't use isWaiting in the below; it returns true for WAITING and WAITING_TIMEOUT if (getState() == ProcedureState.WAITING && childrenCountDown()) { setState(ProcedureState.RUNNABLE); return true; } else { return false; } }
procedure.setState(ProcedureState.RUNNABLE); store.update(procedure);
private void cleanupAfterRollbackOneStep(Procedure<TEnvironment> proc) { if (proc.removeStackIndex()) { if (!proc.isSuccess()) { proc.setState(ProcedureState.ROLLEDBACK); } // update metrics on finishing the procedure (fail) proc.updateMetricsOnFinish(getEnvironment(), proc.elapsedTime(), false); if (proc.hasParent()) { store.delete(proc.getProcId()); procedures.remove(proc.getProcId()); } else { final long[] childProcIds = rollbackStack.get(proc.getProcId()).getSubprocedureIds(); if (childProcIds != null) { store.delete(proc, childProcIds); } else { store.update(proc); } } } else { store.update(proc); } }
proc.setState(ProcedureState.RUNNABLE); runnableList.add(proc); } else {
} else if (!suspended) { procedure.setState(ProcedureState.SUCCESS);
switch (procedure.getState()) { case RUNNABLE: procedure.setState(ProcedureState.WAITING); break; case WAITING_TIMEOUT:
proc.setState(proto.getState()); proc.setSubmittedTime(proto.getSubmittedTime()); proc.setLastUpdate(proto.getLastUpdate());
protected synchronized void setFailure(final RemoteProcedureException exception) { this.exception = exception; if (!isFinished()) { setState(ProcedureState.FAILED); } }
protected synchronized void setFailure(final RemoteProcedureException exception) { this.exception = exception; if (!isFinished()) { setState(ProcedureState.FAILED); } }
protected synchronized void setFailure(final RemoteProcedureException exception) { this.exception = exception; if (!isFinished()) { setState(ProcedureState.FINISHED); } }
/** * Called by the ProcedureExecutor to assign the ID to the newly created procedure. */ @VisibleForTesting protected void setProcId(long procId) { this.procId = procId; this.submittedTime = EnvironmentEdgeManager.currentTime(); setState(ProcedureState.RUNNABLE); }
/** * Try to set this procedure into RUNNABLE state. * Succeeds if all subprocedures/children are done. * @return True if we were able to move procedure to RUNNABLE state. */ synchronized boolean tryRunnable() { // Don't use isWaiting in the below; it returns true for WAITING and WAITING_TIMEOUT boolean b = getState() == ProcedureState.WAITING && childrenCountDown(); if (b) setState(ProcedureState.RUNNABLE); return b; }
/** * Try to set this procedure into RUNNABLE state. * Succeeds if all subprocedures/children are done. * @return True if we were able to move procedure to RUNNABLE state. */ synchronized boolean tryRunnable() { // Don't use isWaiting in the below; it returns true for WAITING and WAITING_TIMEOUT if (getState() == ProcedureState.WAITING && childrenCountDown()) { setState(ProcedureState.RUNNABLE); return true; } else { return false; } }
/** * Called by the ProcedureExecutor to assign the ID to the newly created procedure. */ @VisibleForTesting @InterfaceAudience.Private protected void setProcId(final long procId) { this.procId = procId; this.submittedTime = EnvironmentEdgeManager.currentTime(); setState(ProcedureState.RUNNABLE); }
/** * Called by the ProcedureExecutor to assign the ID to the newly created procedure. */ @VisibleForTesting @InterfaceAudience.Private protected void setProcId(final long procId) { this.procId = procId; this.startTime = EnvironmentEdgeManager.currentTime(); setState(ProcedureState.RUNNABLE); }
private void cleanupAfterRollbackOneStep(Procedure<TEnvironment> proc) { if (proc.removeStackIndex()) { if (!proc.isSuccess()) { proc.setState(ProcedureState.ROLLEDBACK); } // update metrics on finishing the procedure (fail) proc.updateMetricsOnFinish(getEnvironment(), proc.elapsedTime(), false); if (proc.hasParent()) { store.delete(proc.getProcId()); procedures.remove(proc.getProcId()); } else { final long[] childProcIds = rollbackStack.get(proc.getProcId()).getSubprocedureIds(); if (childProcIds != null) { store.delete(proc, childProcIds); } else { store.update(proc); } } } else { store.update(proc); } }
switch (procedure.getState()) { case RUNNABLE: procedure.setState(ProcedureState.WAITING); break; case WAITING_TIMEOUT:
switch (procedure.getState()) { case RUNNABLE: procedure.setState(ProcedureState.WAITING); break; case WAITING_TIMEOUT: