Class SubClusterPolicyConfiguration

java.lang.Object
org.apache.hadoop.yarn.server.federation.store.records.SubClusterPolicyConfiguration
Direct Known Subclasses:
SubClusterPolicyConfigurationPBImpl

@Private @Unstable public abstract class SubClusterPolicyConfiguration extends Object
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 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

      @Public @Unstable public abstract String getQueue()
      Get the name of the queue for which we are configuring a policy.
      Returns:
      the name of the queue
    • setQueue

      @Private @Unstable public abstract void setQueue(String queueName)
      Sets the name of the queue for which we are configuring a policy.
      Parameters:
      queueName - the name of the queue
    • getType

      @Public @Unstable public abstract String getType()
      Get the type of the policy. This could be random, round-robin, load-based, etc.
      Returns:
      the type of the policy
    • setType

      @Private @Unstable public abstract void setType(String policyType)
      Sets the type of the policy. This could be random, round-robin, load-based, etc.
      Parameters:
      policyType - the type of the policy
    • getParams

      @Public @Unstable public abstract ByteBuffer 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

      @Private @Unstable public abstract void setParams(ByteBuffer policyParams)
      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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object