Class SubClusterPolicyConfiguration
java.lang.Object
org.apache.hadoop.yarn.server.federation.store.records.SubClusterPolicyConfiguration
- Direct Known Subclasses:
SubClusterPolicyConfigurationPBImpl
SubClusterPolicyConfiguration is a class that represents a
configuration of a policy. For a single queue, it contains a policy type
(resolve to a class name) and its params as an opaque ByteBuffer.
Note: by design the params are an opaque ByteBuffer, this allows for enough
flexibility to evolve the policies without impacting the protocols to/from
the federation state store.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanabstract ByteBufferGet the policy parameters.abstract StringgetQueue()Get the name of the queue for which we are configuring a policy.abstract StringgetType()Get the type of the policy.inthashCode()newInstance(String queue, String policyType, ByteBuffer policyParams) abstract voidsetParams(ByteBuffer policyParams) Set the policy parameters.abstract voidSets the name of the queue for which we are configuring a policy.abstract voidSets the type of the policy.toString()
-
Constructor Details
-
SubClusterPolicyConfiguration
public SubClusterPolicyConfiguration()
-
-
Method Details
-
newInstance
@Private @Unstable public static SubClusterPolicyConfiguration newInstance(String queue, String policyType, ByteBuffer policyParams) -
newInstance
@Private @Unstable public static SubClusterPolicyConfiguration newInstance(SubClusterPolicyConfiguration conf) -
getQueue
Get the name of the queue for which we are configuring a policy.- Returns:
- the name of the queue
-
setQueue
Sets the name of the queue for which we are configuring a policy.- Parameters:
queueName- the name of the queue
-
getType
Get the type of the policy. This could be random, round-robin, load-based, etc.- Returns:
- the type of the policy
-
setType
Sets the type of the policy. This could be random, round-robin, load-based, etc.- Parameters:
policyType- the type of the policy
-
getParams
Get the policy parameters. This affects how the policy behaves and an example could be weight distribution of queues across multiple sub-clusters.- Returns:
- the byte array that contains the parameters
-
setParams
Set the policy parameters. This affects how the policy behaves and an example could be weight distribution of queues across multiple sub-clusters.- Parameters:
policyParams- byte array that describes the policy
-
hashCode
public int hashCode() -
equals
-
toString
-