Class AllocationConfiguration
java.lang.Object
org.apache.hadoop.conf.Configuration
org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationSchedulerConfiguration
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationConfiguration
-
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
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationSchedulerConfiguration
DEFAULT_CAPACITY_OVER_TIME_MULTIPLIER, DEFAULT_RESERVATION_ADMISSION_POLICY, DEFAULT_RESERVATION_AGENT_NAME, DEFAULT_RESERVATION_ENFORCEMENT_WINDOW, DEFAULT_RESERVATION_MOVE_ON_EXPIRY, DEFAULT_RESERVATION_PLANNER_NAME, DEFAULT_RESERVATION_WINDOW, DEFAULT_SHOW_RESERVATIONS_AS_QUEUES -
Constructor Summary
ConstructorsConstructorDescriptionAllocationConfiguration(QueueProperties queueProperties, AllocationFileParser allocationFileParser, ReservationQueueConfiguration globalReservationQueueConfig) Create a fully initialised configuration for the scheduler.AllocationConfiguration(FairScheduler scheduler) Create a base scheduler configuration with just the defaults set. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetAverageCapacity(QueuePath queue) Gets the average allowed capacity which will aggregated over theReservationSchedulerConfiguration.getReservationWindow(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath)by the theSharingPolicyto check aggregate used capacitylonggetEnforcementWindow(QueuePath queue) Gets the time in milliseconds for which thePlannerwill verify thePlans satisfy the constraintsfloatgetFairSharePreemptionThreshold(String queueName) Get a queue's fair share preemption threshold in the allocation file.longgetFairSharePreemptionTimeout(String queueName) Get a queue's fair share preemption timeout configured in the allocation file, in milliseconds.floatGets the maximum capacity at any time that theSharingPolicyallowslonggetMinSharePreemptionTimeout(String queueName) Get a queue's min share preemption timeout configured in the allocation file, in milliseconds.booleangetMoveOnExpiry(QueuePath queue) Gets whether the applications should be killed or moved to the parent queue when theReservationDefinitionexpiresMap<String,Map<org.apache.hadoop.yarn.security.AccessType, org.apache.hadoop.security.authorize.AccessControlList>> Get the map of ACLs of all queues.floatintgetReplanner(QueuePath queue) Gets the name of thePlannerclass associated with the queueMap<org.apache.hadoop.yarn.api.records.ReservationACL,org.apache.hadoop.security.authorize.AccessControlList> getReservationAcls(QueuePath queue) Gets a map containing theAccessControlListof users for eachReservationACLacl on thee specified queue.Gets the name of theSharingPolicyclass associated with the queuegetReservationAgent(QueuePath queue) Gets the name of theReservationAgentclass associated with the queuelonggetReservationWindow(QueuePath queue) Gets the length of time in milliseconds for which theSharingPolicychecks for validitybooleanChecks whether the reservation queues be hidden or visibleintgetUserMaxApps(String user) intvoidinitFSQueue(FSQueue queue) Initialize aFSQueuewith queue-specific properties and its metrics.booleanisPreemptable(String queueName) booleanisReservable(QueuePath queue) Checks if the queue participates in reservation based schedulingvoidsetAverageCapacity(int avgCapacity) voidsetReservationWindow(long window) 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
-
Constructor Details
-
AllocationConfiguration
public AllocationConfiguration(QueueProperties queueProperties, AllocationFileParser allocationFileParser, ReservationQueueConfiguration globalReservationQueueConfig) throws AllocationConfigurationException Create a fully initialised configuration for the scheduler.- Parameters:
queueProperties- The list of queues and their properties from the configuration.allocationFileParser- The allocation file parserglobalReservationQueueConfig- The reservation queue config- Throws:
AllocationConfigurationException- for any errors.
-
AllocationConfiguration
Create a base scheduler configuration with just the defaults set. Should only be called to init a basic setup on scheduler init.- Parameters:
scheduler- TheFairSchedulerto create and initialise the placement policy.
-
-
Method Details
-
getQueueAcls
public Map<String,Map<org.apache.hadoop.yarn.security.AccessType, getQueueAcls()org.apache.hadoop.security.authorize.AccessControlList>> Get the map of ACLs of all queues.- Returns:
- the map of ACLs of all queues
-
getReservationAcls
public Map<org.apache.hadoop.yarn.api.records.ReservationACL,org.apache.hadoop.security.authorize.AccessControlList> getReservationAcls(QueuePath queue) Description copied from class:ReservationSchedulerConfigurationGets a map containing theAccessControlListof users for eachReservationACLacl on thee specified queue.- Specified by:
getReservationAclsin classReservationSchedulerConfiguration- Parameters:
queue- the queue with which to check a user's permissions.- Returns:
- The a Map of
ReservationACLtoAccessControlListwhich contains a list of users that have the specified permission level.
-
isPreemptable
-
getUserMaxApps
-
getUserMaxApps
-
getQueueMaxAppsDefault
public int getQueueMaxAppsDefault() -
getUserMaxAppsDefault
public int getUserMaxAppsDefault() -
getDefaultSchedulingPolicy
-
getConfiguredQueues
-
isReservable
Description copied from class:ReservationSchedulerConfigurationChecks if the queue participates in reservation based scheduling- Specified by:
isReservablein classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- true if the queue participates in reservation based scheduling
-
getReservationWindow
Description copied from class:ReservationSchedulerConfigurationGets the length of time in milliseconds for which theSharingPolicychecks for validity- Overrides:
getReservationWindowin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- length in time in milliseconds for which to check the
SharingPolicy
-
getAverageCapacity
Description copied from class:ReservationSchedulerConfigurationGets the average allowed capacity which will aggregated over theReservationSchedulerConfiguration.getReservationWindow(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.QueuePath)by the theSharingPolicyto check aggregate used capacity- Overrides:
getAverageCapacityin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- average capacity allowed by the
SharingPolicy
-
getInstantaneousMaxCapacity
Description copied from class:ReservationSchedulerConfigurationGets the maximum capacity at any time that theSharingPolicyallows- Overrides:
getInstantaneousMaxCapacityin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- maximum allowed capacity at any time
-
getReservationAdmissionPolicy
Description copied from class:ReservationSchedulerConfigurationGets the name of theSharingPolicyclass associated with the queue- Overrides:
getReservationAdmissionPolicyin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- the class name of the
SharingPolicy
-
getReservationAgent
Description copied from class:ReservationSchedulerConfigurationGets the name of theReservationAgentclass associated with the queue- Overrides:
getReservationAgentin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- the class name of the
ReservationAgent
-
getShowReservationAsQueues
Description copied from class:ReservationSchedulerConfigurationChecks whether the reservation queues be hidden or visible- Overrides:
getShowReservationAsQueuesin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- true if reservation queues should be visible
-
getReplanner
Description copied from class:ReservationSchedulerConfigurationGets the name of thePlannerclass associated with the queue- Overrides:
getReplannerin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- the class name of the
Planner
-
getMoveOnExpiry
Description copied from class:ReservationSchedulerConfigurationGets whether the applications should be killed or moved to the parent queue when theReservationDefinitionexpires- Overrides:
getMoveOnExpiryin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- true if application should be moved, false if they need to be killed
-
getEnforcementWindow
Description copied from class:ReservationSchedulerConfigurationGets the time in milliseconds for which thePlannerwill verify thePlans satisfy the constraints- Overrides:
getEnforcementWindowin classReservationSchedulerConfiguration- Parameters:
queue- name of the queue- Returns:
- the time in milliseconds for which to check constraints
-
setReservationWindow
@VisibleForTesting public void setReservationWindow(long window) -
setAverageCapacity
@VisibleForTesting public void setAverageCapacity(int avgCapacity) -
initFSQueue
Initialize aFSQueuewith queue-specific properties and its metrics.- Parameters:
queue- the FSQueue needed to be initialized
-