public class FairOrderingPolicy<S extends SchedulableEntity> extends AbstractComparatorOrderingPolicy<S>
Modifier and Type | Class and Description |
---|---|
protected class |
FairOrderingPolicy.FairComparator |
Modifier and Type | Field and Description |
---|---|
static String |
ENABLE_SIZE_BASED_WEIGHT |
comparator, entitiesToReorder, schedulableEntities
Constructor and Description |
---|
FairOrderingPolicy() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Map<String,String> conf)
Provides configuration information for the policy from the scheduler
configuration.
|
void |
containerAllocated(S schedulableEntity,
RMContainer r)
Notify the
OrderingPolicy that the SchedulableEntity
has been allocated the given RMContainer , enabling the
OrderingPolicy to take appropriate action. |
void |
containerReleased(S schedulableEntity,
RMContainer r)
Notify the
OrderingPolicy that the SchedulableEntity
has released the given RMContainer , enabling the
OrderingPolicy to take appropriate action. |
void |
demandUpdated(S schedulableEntity)
Notify the
OrderingPolicy that the demand for the
SchedulableEntity has been updated, enabling the
OrderingPolicy to reorder the SchedulableEntity if needed. |
String |
getConfigName()
Return configuration name (which will be used to set ordering policy).
|
String |
getInfo()
Return information regarding configuration and status.
|
boolean |
getSizeBasedWeight() |
void |
setSizeBasedWeight(boolean sizeBasedWeight) |
addAllSchedulableEntities, addSchedulableEntity, entityRequiresReordering, getAssignmentIterator, getComparator, getNumSchedulableEntities, getPreemptionIterator, getSchedulableEntities, removeSchedulableEntity, reorderSchedulableEntity, reorderScheduleEntities, updateSchedulingResourceUsage
public static final String ENABLE_SIZE_BASED_WEIGHT
public boolean getSizeBasedWeight()
public void setSizeBasedWeight(boolean sizeBasedWeight)
public void configure(Map<String,String> conf)
OrderingPolicy
configure
in interface OrderingPolicy<S extends SchedulableEntity>
configure
in class AbstractComparatorOrderingPolicy<S extends SchedulableEntity>
conf
- a map of scheduler configuration properties and valuespublic void containerAllocated(S schedulableEntity, RMContainer r)
OrderingPolicy
OrderingPolicy
that the SchedulableEntity
has been allocated the given RMContainer
, enabling the
OrderingPolicy
to take appropriate action. Depending on the
comparator, a reordering of the SchedulableEntity
may be required.containerAllocated
in interface OrderingPolicy<S extends SchedulableEntity>
containerAllocated
in class AbstractComparatorOrderingPolicy<S extends SchedulableEntity>
schedulableEntity
- the SchedulableEntity
r
- the allocated RMContainer
public void containerReleased(S schedulableEntity, RMContainer r)
OrderingPolicy
OrderingPolicy
that the SchedulableEntity
has released the given RMContainer
, enabling the
OrderingPolicy
to take appropriate action. Depending on the
comparator, a reordering of the SchedulableEntity
may be required.containerReleased
in interface OrderingPolicy<S extends SchedulableEntity>
containerReleased
in class AbstractComparatorOrderingPolicy<S extends SchedulableEntity>
schedulableEntity
- the SchedulableEntity
r
- the released RMContainer
public void demandUpdated(S schedulableEntity)
OrderingPolicy
OrderingPolicy
that the demand for the
SchedulableEntity
has been updated, enabling the
OrderingPolicy
to reorder the SchedulableEntity
if needed.demandUpdated
in interface OrderingPolicy<S extends SchedulableEntity>
demandUpdated
in class AbstractComparatorOrderingPolicy<S extends SchedulableEntity>
schedulableEntity
- the updated SchedulableEntity
public String getInfo()
OrderingPolicy
getInfo
in interface OrderingPolicy<S extends SchedulableEntity>
getInfo
in class AbstractComparatorOrderingPolicy<S extends SchedulableEntity>
public String getConfigName()
OrderingPolicy
getConfigName
in interface OrderingPolicy<S extends SchedulableEntity>
getConfigName
in class AbstractComparatorOrderingPolicy<S extends SchedulableEntity>
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.