public class Scheduler extends Object implements InstanceListener, SlotAvailabilityListener
| Constructor and Description |
|---|
Scheduler() |
public void shutdown()
public SimpleSlot scheduleImmediately(ScheduledUnit task) throws NoResourceAvailableException
NoResourceAvailableExceptionpublic SlotAllocationFuture scheduleQueued(ScheduledUnit task) throws NoResourceAvailableException
NoResourceAvailableExceptionprotected SimpleSlot getFreeSlotForTask(ExecutionVertex vertex, Iterable<Instance> requestedLocations, boolean localOnly)
NOTE: This method does is not thread-safe, it needs to be synchronized by the caller.
vertex - The task to run.null, if no instance is available.protected SimpleSlot getFreeSubSlotForTask(ExecutionVertex vertex, Iterable<Instance> requestedLocations, SlotSharingGroupAssignment groupAssignment, CoLocationConstraint constraint, boolean localOnly)
public void newSlotAvailable(Instance instance)
newSlotAvailable in interface SlotAvailabilityListenerpublic void newInstanceAvailable(Instance instance)
InstanceListenernewInstanceAvailable in interface InstanceListenerinstance - The instance that became available.public void instanceDied(Instance instance)
InstanceListenerinstanceDied in interface InstanceListenerinstance - The instance that died.public int getNumberOfAvailableSlots()
public int getTotalNumberOfSlots()
public int getNumberOfAvailableInstances()
public int getNumberOfInstancesWithAvailableSlots()
public int getNumberOfUnconstrainedAssignments()
public int getNumberOfLocalizedAssignments()
public int getNumberOfNonLocalizedAssignments()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.