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); } }
throw new IllegalExecutionStateException(this, CREATED, state);
throw new IllegalExecutionStateException(this, CREATED, state);
throw new IllegalExecutionStateException(this, CREATED, state);
} else { throw new IllegalExecutionStateException(this, CREATED, state);