@InterfaceAudience.Private @InterfaceStability.Unstable public class DefaultPlacementRule extends FSPlacementRule
Modifier and Type | Field and Description |
---|---|
String |
defaultQueueName |
createQueue
Constructor and Description |
---|
DefaultPlacementRule() |
Modifier and Type | Method and Description |
---|---|
ApplicationPlacementContext |
getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc,
String user)
Return the scheduler queue name the application should be placed in
wrapped in an
ApplicationPlacementContext object. |
boolean |
initialize(ResourceScheduler scheduler)
Standard initialisation for
FairScheduler rules, shared by all
rules. |
void |
setConfig(Boolean create)
Set the rule config just setting the create flag.
|
void |
setConfig(Element conf)
Set the rule config from the xml config.
|
getCreateFlag, getParentRule, setConfig, setParentRule
getName, getPlacementForApp
@VisibleForTesting public String defaultQueueName
public void setConfig(Element conf)
setConfig
in class FSPlacementRule
conf
- An xml element from the FairScheduler.conf
public void setConfig(Boolean create)
setConfig
in class FSPlacementRule
create
- flag to allow queue creation for this rulepublic boolean initialize(ResourceScheduler scheduler) throws IOException
FSPlacementRule
FairScheduler
rules, shared by all
rules. Each rule that extends this abstract and overrides this method must
call super.initialize()
to run this basic initialisation.initialize
in class FSPlacementRule
scheduler
- the scheduler using the ruletrue
in all casesIOException
- for any errorspublic ApplicationPlacementContext getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user)
PlacementRule
ApplicationPlacementContext
object.
A non null
return value places the application in a queue,
a null
value means the queue is not yet determined. The
next PlacementRule
in the list maintained in the
PlacementManager
will be executed.getPlacementForApp
in class PlacementRule
asc
- The context of the application created on submissionuser
- The name of the user submitting the applicationApplicationPlacementContext
or
null
if no queue was resolvedCopyright © 2008–2024 Apache Software Foundation. All rights reserved.