Class TargetApplicationsNamespace
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.TargetApplicationsNamespace
- All Implemented Interfaces:
Evaluable<TargetApplications>
- Direct Known Subclasses:
TargetApplicationsNamespace.All,TargetApplicationsNamespace.AppID,TargetApplicationsNamespace.AppTag,TargetApplicationsNamespace.NotSelf,TargetApplicationsNamespace.Self
public abstract class TargetApplicationsNamespace
extends Object
implements Evaluable<TargetApplications>
Class to describe the namespace of allocation tags, used by
AllocationTags. Each namespace can be evaluated against
a target set applications, represented by TargetApplications.
After evaluation, the namespace is interpreted to be a set of
applications based on the namespace type.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNamespace to all applications in the cluster.static classNamespace defined by a certain application ID.static classNamespace to applications that attached with a certain application tag.static classNamespace to all applications except itself.static classNamespace within application itself. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTargetApplicationsNamespace(org.apache.hadoop.yarn.api.records.AllocationTagNamespaceType allocationTagNamespaceType) -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate(TargetApplications target) Evaluate the namespace against given target applications if it is necessary.Set<org.apache.hadoop.yarn.api.records.ApplicationId>Get the scope of the namespace, in form of a set of applications.org.apache.hadoop.yarn.api.records.AllocationTagNamespaceTypeGet the type of the namespace.static TargetApplicationsNamespaceParse namespace from a string.protected voidsetScopeIfNotNull(Set<org.apache.hadoop.yarn.api.records.ApplicationId> appIds) toString()
-
Field Details
-
NAMESPACE_DELIMITER
- See Also:
-
-
Constructor Details
-
TargetApplicationsNamespace
public TargetApplicationsNamespace(org.apache.hadoop.yarn.api.records.AllocationTagNamespaceType allocationTagNamespaceType)
-
-
Method Details
-
setScopeIfNotNull
-
getNamespaceType
public org.apache.hadoop.yarn.api.records.AllocationTagNamespaceType getNamespaceType()Get the type of the namespace.- Returns:
- namespace type.
-
getNamespaceScope
Get the scope of the namespace, in form of a set of applications.- Returns:
- a set of applications.
-
evaluate
Evaluate the namespace against given target applications if it is necessary. Only self/not-self/app-label namespace types require this evaluation step, because they are not binding to a specific scope during initiating. So we do lazy binding for them in this method.- Specified by:
evaluatein interfaceEvaluable<TargetApplications>- Parameters:
target- a generic type target that impacts this evaluation.- Throws:
InvalidAllocationTagsQueryException- if given string is not in valid format.
-
toString
-
parse
public static TargetApplicationsNamespace parse(String namespaceStr) throws InvalidAllocationTagsQueryException Parse namespace from a string. The string must be in legal format defined by eachAllocationTagNamespaceType.- Parameters:
namespaceStr- namespace string.- Returns:
- an instance of
TargetApplicationsNamespace. - Throws:
InvalidAllocationTagsQueryException- if given string is not in valid format
-