public class Scheduler extends Object implements InstanceListener, SlotAvailabilityListener
| Constructor and Description |
|---|
Scheduler() |
Scheduler(ExecutorService executorService) |
public Scheduler()
public Scheduler(ExecutorService executorService)
public void shutdown()
public int getNumberOfAvailableSlots()
public int getTotalNumberOfSlots()
public SimpleSlot scheduleImmediately(ScheduledUnit task) throws NoResourceAvailableException
NoResourceAvailableExceptionpublic SlotAllocationFuture scheduleQueued(ScheduledUnit task) throws NoResourceAvailableException
NoResourceAvailableExceptionprotected SimpleSlot getFreeSlotForTask(ExecutionVertex vertex, Iterable<Instance> requestedLocations)
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)
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 getNumberOfAvailableInstances()
public int getNumberOfInstancesWithAvailableSlots()
public int getNumberOfUnconstrainedAssignments()
public int getNumberOfLocalizedAssignments()
public int getNumberOfNonLocalizedAssignments()
Copyright © 2015 The Apache Software Foundation. All rights reserved.