Class FairSchedulerConfiguration
java.lang.Object
org.apache.hadoop.conf.Configuration
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairSchedulerConfiguration
@Private
@Evolving
public class FairSchedulerConfiguration
extends org.apache.hadoop.conf.Configuration
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.conf.Configuration
org.apache.hadoop.conf.Configuration.DeprecationDelta, org.apache.hadoop.conf.Configuration.IntegerRanges -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringWhether pools can be created that were not specified in the FS configuration fileprotected static final Stringprotected static final Stringstatic final StringWhether to assign multiple containers in one check-in.static final StringDeprecated.static final StringDeprecated.Continuous scheduling is known to cause locking issue inside Only used whenCONTINUOUS_SCHEDULING_ENABLEDis enabledprotected static final Stringstatic final booleanprotected static final booleanstatic final booleanstatic final booleanDeprecated.static final intDeprecated.protected static final longDeprecated.protected static final longDeprecated.protected static final floatstatic final floatstatic final floatstatic final intstatic final booleanprotected static final floatstatic final intDeprecated.static final intDeprecated.static final floatstatic final booleanstatic final intstatic final booleanstatic final intstatic final longstatic final StringMaximum number of containers to assign on each check-in.protected static final StringDeprecated.Continuous scheduling is known to cause locking issue inside Only used whenCONTINUOUS_SCHEDULING_ENABLEDis enabledprotected static final StringDeprecated.Continuous scheduling is known to cause locking issue inside Only used whenCONTINUOUS_SCHEDULING_ENABLEDis enabledstatic final StringCluster threshold for node locality.static final StringCluster threshold for rack locality.static final org.slf4j.Loggerstatic final StringSpecify exact number of containers to assign on each heartbeat, if dynamic max assign is turned off.static final StringUsed during FS->CS conversion.static final StringDisables checking whether a placement rule is terminal or not.static final StringWhether preemption is enabled.protected static final Stringstatic final StringRatio of nodes available for an app to make an reservation on.static final floatstatic final StringDeprecated.The preferred way to configure the increment is by using the yarn.resource-types.static final StringDeprecated.The preferred way to configure the increment is by using the yarn.resource-types.static final StringThreshold for container size for making a container reservation as a multiple of increment allocation.static final StringWhether to give more weight to apps requiring many resources.static final StringThe update interval for calculating resources in FairScheduler .static final StringWhether to use the user name as the queue name (instead of "default") if the request does not specify a queue.static final Stringstatic final StringConfigurable delay (ms) before an app's starvation is considered after it is identified. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAMPreemptionEnabled(String queueName) booleanintDeprecated.linked toCONTINUOUS_SCHEDULING_ENABLEDdeprecationorg.apache.hadoop.yarn.api.records.ResourcelongDeprecated.linked toCONTINUOUS_SCHEDULING_ENABLEDdeprecationlongDeprecated.linked toCONTINUOUS_SCHEDULING_ENABLEDdeprecationfloatfloatintorg.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.api.records.ResourcebooleanfloatfloatfloatbooleanlongbooleanintlongbooleanDeprecated.useASSIGN_MULTIPLEto improve container allocation ramp up.booleanstatic ConfigurableResourceparseResourceConfigValue(String value) Parses a resource config value in one of three forms: Percentage: "50%" or "40% memory, 60% cpu" New style resources: "vcores=10, memory-mb=1024" or "vcores=60%, memory-mb=40%" Old style resources: "1024 mb, 10 vcores" In new style resources, any resource that is not specified will be set toLong.MAX_VALUEor 100%, as appropriate.static ConfigurableResourceparseResourceConfigValue(String value, long missing) Parses a resource config value in one of three forms: Percentage: "50%" or "40% memory, 60% cpu" New style resources: "vcores=10, memory-mb=1024" or "vcores=60%, memory-mb=40%" Old style resources: "1024 mb, 10 vcores" In new style resources, any resource that is not specified will be set tomissingor 0%, as appropriate.Methods inherited from class org.apache.hadoop.conf.Configuration
addDefaultResource, addDeprecation, addDeprecation, addDeprecation, addDeprecation, addDeprecations, addResource, addResource, addResource, addResource, addResource, addResource, addResource, addResource, addResource, addResource, addResource, addTags, clear, dumpConfiguration, dumpConfiguration, dumpDeprecatedKeys, get, get, getAllPropertiesByTag, getAllPropertiesByTags, getBoolean, getClass, getClass, getClassByName, getClassByNameOrNull, getClasses, getClassLoader, getConfResourceAsInputStream, getConfResourceAsReader, getDouble, getEnum, getEnumSet, getFile, getFinalParameters, getFloat, getInstances, getInt, getInts, getLocalPath, getLong, getLongBytes, getPassword, getPasswordFromConfig, getPasswordFromCredentialProviders, getPattern, getPropertySources, getProps, getPropsWithPrefix, getRange, getRaw, getResource, getSocketAddr, getSocketAddr, getStorageSize, getStorageSize, getStringCollection, getStrings, getStrings, getTimeDuration, getTimeDuration, getTimeDuration, getTimeDuration, getTimeDurationHelper, getTimeDurations, getTrimmed, getTrimmed, getTrimmedStringCollection, getTrimmedStrings, getTrimmedStrings, getValByRegex, hasWarnedDeprecation, isDeprecated, isPropertyTag, iterator, main, onlyKeyExists, readFields, reloadConfiguration, reloadExistingConfigurations, set, set, setAllowNullValueProperties, setBoolean, setBooleanIfUnset, setClass, setClassLoader, setDeprecatedProperties, setDouble, setEnum, setFloat, setIfUnset, setInt, setLong, setPattern, setQuietMode, setRestrictSystemProperties, setRestrictSystemPropertiesDefault, setRestrictSystemProps, setSocketAddr, setStorageSize, setStrings, setTimeDuration, size, substituteCommonVariables, toString, unset, updateConnectAddr, updateConnectAddr, write, writeXml, writeXml, writeXml, writeXmlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
RM_SCHEDULER_INCREMENT_ALLOCATION_MB
Deprecated.The preferred way to configure the increment is by using the yarn.resource-types.{RESOURCE_NAME}.increment-allocation property, for memory: yarn.resource-types.memory-mb.increment-allocationResource Increment request grant-able by the FairScheduler. This property is looked up in the yarn-site.xml.- See Also:
-
DEFAULT_RM_SCHEDULER_INCREMENT_ALLOCATION_MB
Deprecated.- See Also:
-
RM_SCHEDULER_INCREMENT_ALLOCATION_VCORES
Deprecated.The preferred way to configure the increment is by using the yarn.resource-types.{RESOURCE_NAME}.increment-allocation property, for CPU: yarn.resource-types.vcores.increment-allocationResource Increment request grant-able by the FairScheduler. This property is looked up in the yarn-site.xml.- See Also:
-
DEFAULT_RM_SCHEDULER_INCREMENT_ALLOCATION_VCORES
Deprecated.- See Also:
-
RM_SCHEDULER_RESERVATION_THRESHOLD_INCREMENT_MULTIPLE
Threshold for container size for making a container reservation as a multiple of increment allocation. Only container sizes above this are allowed to reserve a node- See Also:
-
DEFAULT_RM_SCHEDULER_RESERVATION_THRESHOLD_INCREMENT_MULTIPLE
public static final float DEFAULT_RM_SCHEDULER_RESERVATION_THRESHOLD_INCREMENT_MULTIPLE- See Also:
-
MIGRATION_MODE
Used during FS->CS conversion. When enabled, background threads are not started. This property should NOT be used by end-users!- See Also:
-
NO_TERMINAL_RULE_CHECK
Disables checking whether a placement rule is terminal or not. Only used during migration mode. This property should NOT be used by end users!- See Also:
-
ALLOCATION_FILE
- See Also:
-
DEFAULT_ALLOCATION_FILE
- See Also:
-
ALLOW_UNDECLARED_POOLS
Whether pools can be created that were not specified in the FS configuration file- See Also:
-
DEFAULT_ALLOW_UNDECLARED_POOLS
public static final boolean DEFAULT_ALLOW_UNDECLARED_POOLS- See Also:
-
USER_AS_DEFAULT_QUEUE
Whether to use the user name as the queue name (instead of "default") if the request does not specify a queue.- See Also:
-
DEFAULT_USER_AS_DEFAULT_QUEUE
public static final boolean DEFAULT_USER_AS_DEFAULT_QUEUE- See Also:
-
DEFAULT_LOCALITY_THRESHOLD
protected static final float DEFAULT_LOCALITY_THRESHOLD- See Also:
-
LOCALITY_THRESHOLD_NODE
Cluster threshold for node locality.- See Also:
-
DEFAULT_LOCALITY_THRESHOLD_NODE
public static final float DEFAULT_LOCALITY_THRESHOLD_NODE- See Also:
-
LOCALITY_THRESHOLD_RACK
Cluster threshold for rack locality.- See Also:
-
DEFAULT_LOCALITY_THRESHOLD_RACK
public static final float DEFAULT_LOCALITY_THRESHOLD_RACK- See Also:
-
LOCALITY_DELAY_NODE_MS
Deprecated.Continuous scheduling is known to cause locking issue inside Only used whenCONTINUOUS_SCHEDULING_ENABLEDis enabledDelay for node locality.- See Also:
-
DEFAULT_LOCALITY_DELAY_NODE_MS
Deprecated.- See Also:
-
LOCALITY_DELAY_RACK_MS
Deprecated.Continuous scheduling is known to cause locking issue inside Only used whenCONTINUOUS_SCHEDULING_ENABLEDis enabledDelay for rack locality.- See Also:
-
DEFAULT_LOCALITY_DELAY_RACK_MS
Deprecated.- See Also:
-
CONTINUOUS_SCHEDULING_ENABLED
Deprecated.Continuous scheduling is known to cause locking issue inside the scheduler in larger cluster, more than 100 nodes, useASSIGN_MULTIPLEto improve container allocation ramp up.Enable continuous scheduling or not.- See Also:
-
DEFAULT_CONTINUOUS_SCHEDULING_ENABLED
Deprecated.- See Also:
-
CONTINUOUS_SCHEDULING_SLEEP_MS
Deprecated.Continuous scheduling is known to cause locking issue inside Only used whenCONTINUOUS_SCHEDULING_ENABLEDis enabledSleep time of each pass in continuous scheduling (5ms in default).- See Also:
-
DEFAULT_CONTINUOUS_SCHEDULING_SLEEP_MS
Deprecated.- See Also:
-
PREEMPTION
Whether preemption is enabled.- See Also:
-
DEFAULT_PREEMPTION
public static final boolean DEFAULT_PREEMPTION- See Also:
-
AM_PREEMPTION
- See Also:
-
AM_PREEMPTION_PREFIX
- See Also:
-
DEFAULT_AM_PREEMPTION
protected static final boolean DEFAULT_AM_PREEMPTION- See Also:
-
PREEMPTION_THRESHOLD
- See Also:
-
DEFAULT_PREEMPTION_THRESHOLD
protected static final float DEFAULT_PREEMPTION_THRESHOLD- See Also:
-
WAIT_TIME_BEFORE_KILL
- See Also:
-
DEFAULT_WAIT_TIME_BEFORE_KILL
public static final int DEFAULT_WAIT_TIME_BEFORE_KILL- See Also:
-
WAIT_TIME_BEFORE_NEXT_STARVATION_CHECK_MS
Configurable delay (ms) before an app's starvation is considered after it is identified. This is to give the scheduler enough time to allocate containers post preemption. This delay is added to theWAIT_TIME_BEFORE_KILLand enough heartbeats. This is intended to be a backdoor on production clusters, and hence intentionally not documented.- See Also:
-
DEFAULT_WAIT_TIME_BEFORE_NEXT_STARVATION_CHECK_MS
public static final long DEFAULT_WAIT_TIME_BEFORE_NEXT_STARVATION_CHECK_MS- See Also:
-
ASSIGN_MULTIPLE
Whether to assign multiple containers in one check-in.- See Also:
-
DEFAULT_ASSIGN_MULTIPLE
public static final boolean DEFAULT_ASSIGN_MULTIPLE- See Also:
-
SIZE_BASED_WEIGHT
Whether to give more weight to apps requiring many resources.- See Also:
-
DEFAULT_SIZE_BASED_WEIGHT
public static final boolean DEFAULT_SIZE_BASED_WEIGHT- See Also:
-
DYNAMIC_MAX_ASSIGN
Maximum number of containers to assign on each check-in.- See Also:
-
MAX_ASSIGN
Specify exact number of containers to assign on each heartbeat, if dynamic max assign is turned off.- See Also:
-
DEFAULT_MAX_ASSIGN
public static final int DEFAULT_MAX_ASSIGN- See Also:
-
UPDATE_INTERVAL_MS
The update interval for calculating resources in FairScheduler .- See Also:
-
DEFAULT_UPDATE_INTERVAL_MS
public static final int DEFAULT_UPDATE_INTERVAL_MS- See Also:
-
RESERVABLE_NODES
Ratio of nodes available for an app to make an reservation on.- See Also:
-
RESERVABLE_NODES_DEFAULT
public static final float RESERVABLE_NODES_DEFAULT- See Also:
-
-
Constructor Details
-
FairSchedulerConfiguration
public FairSchedulerConfiguration() -
FairSchedulerConfiguration
public FairSchedulerConfiguration(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
getMinimumAllocation
public org.apache.hadoop.yarn.api.records.Resource getMinimumAllocation() -
getMaximumAllocation
public org.apache.hadoop.yarn.api.records.Resource getMaximumAllocation() -
getIncrementAllocation
public org.apache.hadoop.yarn.api.records.Resource getIncrementAllocation() -
getReservationThresholdIncrementMultiple
public float getReservationThresholdIncrementMultiple() -
getLocalityThresholdNode
public float getLocalityThresholdNode() -
getLocalityThresholdRack
public float getLocalityThresholdRack() -
isContinuousSchedulingEnabled
Deprecated.useASSIGN_MULTIPLEto improve container allocation ramp up.Whether continuous scheduling is turned on.- Returns:
- whether continuous scheduling is enabled
-
getContinuousSchedulingSleepMs
Deprecated.linked toCONTINUOUS_SCHEDULING_ENABLEDdeprecationThe sleep time of the continuous scheduler thread.- Returns:
- sleep time in ms
-
getLocalityDelayNodeMs
Deprecated.linked toCONTINUOUS_SCHEDULING_ENABLEDdeprecationDelay in milliseconds for locality fallback node to rack.- Returns:
- delay in ms
-
getLocalityDelayRackMs
Deprecated.linked toCONTINUOUS_SCHEDULING_ENABLEDdeprecationDelay in milliseconds for locality fallback rack to other.- Returns:
- delay in ms
-
getPreemptionEnabled
public boolean getPreemptionEnabled() -
getAMPreemptionEnabled
-
getPreemptionUtilizationThreshold
public float getPreemptionUtilizationThreshold() -
getAssignMultiple
public boolean getAssignMultiple() -
isMaxAssignDynamic
public boolean isMaxAssignDynamic() -
getMaxAssign
public int getMaxAssign() -
getSizeBasedWeight
public boolean getSizeBasedWeight() -
getWaitTimeBeforeNextStarvationCheck
public long getWaitTimeBeforeNextStarvationCheck() -
getWaitTimeBeforeKill
public int getWaitTimeBeforeKill() -
getUsePortForNodeName
public boolean getUsePortForNodeName() -
getReservableNodes
public float getReservableNodes() -
parseResourceConfigValue
public static ConfigurableResource parseResourceConfigValue(String value) throws AllocationConfigurationException Parses a resource config value in one of three forms:- Percentage: "50%" or "40% memory, 60% cpu"
- New style resources: "vcores=10, memory-mb=1024" or "vcores=60%, memory-mb=40%"
- Old style resources: "1024 mb, 10 vcores"
Long.MAX_VALUEor 100%, as appropriate. Also, in the new style resources, units are not allowed. Units are assumed from the resource manager's settings for the resources when the value isn't a percentage.- Parameters:
value- the resource definition to parse- Returns:
- a
ConfigurableResourcethat represents the parsed value - Throws:
AllocationConfigurationException- if the raw value is not a valid resource definition
-
parseResourceConfigValue
public static ConfigurableResource parseResourceConfigValue(String value, long missing) throws AllocationConfigurationException Parses a resource config value in one of three forms:- Percentage: "50%" or "40% memory, 60% cpu"
- New style resources: "vcores=10, memory-mb=1024" or "vcores=60%, memory-mb=40%"
- Old style resources: "1024 mb, 10 vcores"
missingor 0%, as appropriate. Also, in the new style resources, units are not allowed. Units are assumed from the resource manager's settings for the resources when the value isn't a percentage. Themissingparameter is only used in the case of new style resources without percentages. With new style resources with percentages, any missing resources will be assumed to be 100% because percentages are only used with maximum resource limits.- Parameters:
value- the resource definition to parsemissing- the value to use for any unspecified resources- Returns:
- a
ConfigurableResourcethat represents the parsed value - Throws:
AllocationConfigurationException- if the raw value is not a valid resource definition
-
getUpdateInterval
public long getUpdateInterval()
-
ASSIGN_MULTIPLEto improve container allocation ramp up.