/** * Set the state to the state recovered when job master failover. */ public void recoverState(ExecutionState recoveredState) { transitionState(state, recoveredState); }
private boolean transitionState(ExecutionState currentState, ExecutionState targetState) { return transitionState(currentState, targetState, null); }
private boolean transitionState(ExecutionState currentState, ExecutionState targetState) { return transitionState(currentState, targetState, null); }
private boolean transitionState(ExecutionState currentState, ExecutionState targetState) { return transitionState(currentState, targetState, null); }
private boolean transitionState(ExecutionState currentState, ExecutionState targetState) { return transitionState(currentState, targetState, null); }
boolean switchToRunning() { if (transitionState(DEPLOYING, RUNNING)) { sendPartitionInfoAsync(); return true;
boolean switchToRunning() { if (transitionState(DEPLOYING, RUNNING)) { sendPartitionInfos(); return true;
boolean switchToRunning() { if (transitionState(DEPLOYING, RUNNING)) { sendPartitionInfos(); return true;
boolean switchToRunning() { if (transitionState(DEPLOYING, RUNNING)) { sendPartitionInfos(); return true;
if (transitionState(current, CANCELING)) { sendCancelRpcCall(); return; if (transitionState(current, CANCELED)) {
if (transitionState(current, CANCELED)) { try { assignedResource.releaseSlot();
if (transitionState(current, CANCELED)) { try { releaseAssignedResource(new FlinkException("Execution " + this + " was cancelled."));
if (transitionState(current, CANCELED)) { try { releaseAssignedResource(new FlinkException("Execution " + this + " was cancelled."));
if (transitionState(current, CANCELED)) { try { releaseAssignedResource(new FlinkException("Execution " + this + " was cancelled."));
if (transitionState(current, FINISHED)) { try { getVertex().finishPartitionsAndNotify();
public Future<SimpleSlot> allocateSlotForExecution(SlotProvider slotProvider, boolean queued) throws IllegalExecutionStateException { checkNotNull(slotProvider); final SlotSharingGroup sharingGroup = vertex.getJobVertex().getSlotSharingGroup(); final CoLocationConstraint locationConstraint = vertex.getLocationConstraint(); // sanity check if (locationConstraint != null && sharingGroup == null) { throw new IllegalStateException( "Trying to schedule with co-location constraint but without slot sharing allowed."); } // this method only works if the execution is in the state 'CREATED' if (transitionState(CREATED, SCHEDULED)) { ScheduledUnit toSchedule = locationConstraint == null ? new ScheduledUnit(this, sharingGroup) : new ScheduledUnit(this, sharingGroup, locationConstraint); return slotProvider.allocateSlot(toSchedule, queued); } else { // call race, already deployed, or already done throw new IllegalExecutionStateException(this, CREATED, state); } }
if (transitionState(current, FINISHED)) { try { for (IntermediateResultPartition finishedPartition
if (transitionState(current, FINISHED)) { try { for (IntermediateResultPartition finishedPartition
if (transitionState(current, FINISHED)) { try { for (IntermediateResultPartition finishedPartition
if (transitionState(CREATED, SCHEDULED)) {