public abstract class AbstractComparatorOrderingPolicy<S extends SchedulableEntity> extends Object implements OrderingPolicy<S>
Modifier and Type | Field and Description |
---|---|
protected Comparator<SchedulableEntity> |
comparator |
protected Map<String,S> |
entitiesToReorder |
protected TreeSet<S> |
schedulableEntities |
Constructor and Description |
---|
AbstractComparatorOrderingPolicy() |
Modifier and Type | Method and Description |
---|---|
void |
addAllSchedulableEntities(Collection<S> sc)
Add a collection of SchedulableEntities to be managed for allocation
and preemption ordering
|
void |
addSchedulableEntity(S s)
Add a SchedulableEntity to be managed for allocation and preemption
ordering
|
abstract void |
configure(Map<String,String> conf)
Provides configuration information for the policy from the scheduler
configuration
|
abstract void |
containerAllocated(S schedulableEntity,
RMContainer r)
The passed SchedulableEntity has been allocated the passed Container,
take appropriate action (depending on comparator, a reordering of the
SchedulableEntity may be required)
|
abstract void |
containerReleased(S schedulableEntity,
RMContainer r)
The passed SchedulableEntity has released the passed Container,
take appropriate action (depending on comparator, a reordering of the
SchedulableEntity may be required)
|
abstract void |
demandUpdated(S schedulableEntity)
Demand Updated for the passed schedulableEntity, reorder if needed.
|
protected void |
entityRequiresReordering(S schedulableEntity) |
Iterator<S> |
getAssignmentIterator()
Return an iterator over the collection of SchedulableEntities which orders
them for container assignment
|
Comparator<SchedulableEntity> |
getComparator() |
abstract String |
getInfo()
Display information regarding configuration and status
|
int |
getNumSchedulableEntities()
Get the number of SchedulableEntities managed for allocation and
preemption ordering
|
Iterator<S> |
getPreemptionIterator()
Return an iterator over the collection of SchedulableEntities which orders
them for preemption
|
Collection<S> |
getSchedulableEntities()
Get the collection of SchedulableEntities which are managed by this
OrderingPolicy - should include processes returned by the Assignment and
Preemption iterator with no guarantees regarding order
|
boolean |
removeSchedulableEntity(S s)
Remove a SchedulableEntity from management for allocation and preemption
ordering
|
protected void |
reorderSchedulableEntity(S schedulableEntity) |
protected void |
reorderScheduleEntities() |
static void |
updateSchedulingResourceUsage(ResourceUsage ru) |
protected TreeSet<S extends SchedulableEntity> schedulableEntities
protected Comparator<SchedulableEntity> comparator
protected Map<String,S extends SchedulableEntity> entitiesToReorder
public Collection<S> getSchedulableEntities()
OrderingPolicy
getSchedulableEntities
in interface OrderingPolicy<S extends SchedulableEntity>
public Iterator<S> getAssignmentIterator()
OrderingPolicy
getAssignmentIterator
in interface OrderingPolicy<S extends SchedulableEntity>
public Iterator<S> getPreemptionIterator()
OrderingPolicy
getPreemptionIterator
in interface OrderingPolicy<S extends SchedulableEntity>
public static void updateSchedulingResourceUsage(ResourceUsage ru)
protected void reorderSchedulableEntity(S schedulableEntity)
protected void reorderScheduleEntities()
protected void entityRequiresReordering(S schedulableEntity)
public Comparator<SchedulableEntity> getComparator()
public void addSchedulableEntity(S s)
OrderingPolicy
addSchedulableEntity
in interface OrderingPolicy<S extends SchedulableEntity>
public boolean removeSchedulableEntity(S s)
OrderingPolicy
removeSchedulableEntity
in interface OrderingPolicy<S extends SchedulableEntity>
public void addAllSchedulableEntities(Collection<S> sc)
OrderingPolicy
addAllSchedulableEntities
in interface OrderingPolicy<S extends SchedulableEntity>
public int getNumSchedulableEntities()
OrderingPolicy
getNumSchedulableEntities
in interface OrderingPolicy<S extends SchedulableEntity>
public abstract void configure(Map<String,String> conf)
OrderingPolicy
configure
in interface OrderingPolicy<S extends SchedulableEntity>
public abstract void containerAllocated(S schedulableEntity, RMContainer r)
OrderingPolicy
containerAllocated
in interface OrderingPolicy<S extends SchedulableEntity>
public abstract void containerReleased(S schedulableEntity, RMContainer r)
OrderingPolicy
containerReleased
in interface OrderingPolicy<S extends SchedulableEntity>
public abstract void demandUpdated(S schedulableEntity)
OrderingPolicy
demandUpdated
in interface OrderingPolicy<S extends SchedulableEntity>
public abstract String getInfo()
OrderingPolicy
getInfo
in interface OrderingPolicy<S extends SchedulableEntity>
Copyright © 2017 Apache Software Foundation. All Rights Reserved.