@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class PlacementRule extends Object
Constructor and Description |
---|
PlacementRule() |
Modifier and Type | Method and Description |
---|---|
String |
getName()
Return the name of the rule.
|
abstract 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. |
abstract boolean |
initialize(ResourceScheduler scheduler)
Initialize the rule with the scheduler.
|
void |
setConfig(Object initArg)
Set the config based on the passed in argument.
|
public void setConfig(Object initArg)
public String getName()
public abstract boolean initialize(ResourceScheduler scheduler) throws IOException
scheduler
- the scheduler using the ruletrue
or false
The outcome of the
initialisation, rule dependent response which might not be persisted in
the rule.IOException
- for any errorspublic abstract ApplicationPlacementContext getPlacementForApp(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext asc, String user) throws org.apache.hadoop.yarn.exceptions.YarnException
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.asc
- The context of the application created on submissionuser
- The name of the user submitting the applicationApplicationPlacementContext
or
null
if no queue was resolvedorg.apache.hadoop.yarn.exceptions.YarnException
- for any error while executing the ruleCopyright © 2008–2022 Apache Software Foundation. All rights reserved.