FederationQueueWeight (Apache Hadoop YARN API 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.server.api.protocolrecords, class: FederationQueueWeight

Package org.apache.hadoop.yarn.server.api.protocolrecords

# Class FederationQueueWeight

java.lang.Object
org.apache.hadoop.yarn.server.api.protocolrecords.FederationQueueWeight

@Private @Unstable public abstract class FederationQueueWeight extends Object
Queue weights for representing Federation.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FederationQueueWeight()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `checkHeadRoomAlphaValid(String headRoomAlpha)`
  Check if HeadRoomAlpha is a number and is between 0 and 1.
  `static void`
  `checkSubClusterQueueWeightRatioValid(String subClusterWeight)`
  Check if the subCluster Queue Weight Ratio are valid.
  `abstract String`
  `getAmrmWeight()`
  `abstract String`
  `getHeadRoomAlpha()`
  `abstract String`
  `getPolicyManagerClassName()`
  `abstract String`
  `getQueue()`
  `abstract String`
  `getRouterWeight()`
  `protected static boolean`
  `isNumeric(String value)`
  Determines whether the given value is a number.
  `static FederationQueueWeight`
  `newInstance(String routerWeight, String amrmWeight, String headRoomAlpha)`
  The FederationQueueWeight object consists of three parts: routerWeight, amrmWeight, and headRoomAlpha.
  `static FederationQueueWeight`
  `newInstance(String routerWeight, String amrmWeight, String headRoomAlpha, String queue, String policyManagerClassName)`
  `abstract void`
  `setAmrmWeight(String amrmWeight)`
  `abstract void`
  `setHeadRoomAlpha(String headRoomAlpha)`
  `abstract void`
  `setPolicyManagerClassName(String policyManagerClassName)`
  `abstract void`
  `setQueue(String queue)`
  `abstract void`
  `setRouterWeight(String routerWeight)`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### FederationQueueWeight

    public FederationQueueWeight()

- ## Method Details

  - ### newInstance

    @Private @Unstable public static FederationQueueWeight newInstance(String routerWeight, String amrmWeight, String headRoomAlpha)
    The FederationQueueWeight object consists of three parts: routerWeight, amrmWeight, and headRoomAlpha.
    Parameters:
      `routerWeight` - Weight for routing applications to different subclusters. We will route the application to different subclusters based on the configured weights. Assuming we have two subclusters, SC-1 and SC-2, with a weight of 0.7 for SC-1 and 0.3 for SC-2, the application will be allocated in such a way that 70% of the applications will be assigned to SC-1 and 30% to SC-2.
      `amrmWeight` - Weight for resource request from ApplicationMaster (AM) to different subclusters' Resource Manager (RM). Assuming we have two subclusters, SC-1 and SC-2, with a weight of 0.6 for SC-1 and 0.4 for SC-2, When AM requesting resources, 60% of the requests will be made to the Resource Manager (RM) of SC-1 and 40% to the RM of SC-2.
      `headRoomAlpha` - used by policies that balance weight-based and load-based considerations in their decisions. For policies that use this parameter, values close to 1 indicate that most of the decision should be based on currently observed headroom from various sub-clusters, values close to zero, indicate that the decision should be mostly based on weights and practically ignore current load.
    Returns:
      FederationQueueWeight

  - ### newInstance

    @Private @Unstable public static FederationQueueWeight newInstance(String routerWeight, String amrmWeight, String headRoomAlpha, String queue, String policyManagerClassName)

  - ### getRouterWeight

    @Public @Unstable public abstract String getRouterWeight()

  - ### setRouterWeight

    @Public @Unstable public abstract void setRouterWeight(String routerWeight)

  - ### getAmrmWeight

    @Public @Unstable public abstract String getAmrmWeight()

  - ### setAmrmWeight

    @Public @Unstable public abstract void setAmrmWeight(String amrmWeight)

  - ### getHeadRoomAlpha

    @Public @Unstable public abstract String getHeadRoomAlpha()

  - ### setHeadRoomAlpha

    @Public @Unstable public abstract void setHeadRoomAlpha(String headRoomAlpha)

  - ### checkSubClusterQueueWeightRatioValid

    public static void checkSubClusterQueueWeightRatioValid(String subClusterWeight) throws YarnException
    Check if the subCluster Queue Weight Ratio are valid. This method can be used to validate RouterPolicyWeight and AMRMPolicyWeight.
    Parameters:
      `subClusterWeight` - the weight ratios of subClusters.
    Throws:
      `YarnException` - exceptions from yarn servers.

  - ### checkHeadRoomAlphaValid

    public static void checkHeadRoomAlphaValid(String headRoomAlpha) throws YarnException
    Check if HeadRoomAlpha is a number and is between 0 and 1.
    Parameters:
      `headRoomAlpha` - headroomalpha.
    Throws:
      `YarnException` - exceptions from yarn servers.

  - ### isNumeric

    protected static boolean isNumeric(String value)
    Determines whether the given value is a number.
    Parameters:
      `value` - given value.
    Returns:
      true, is a number, false, not a number.

  - ### getQueue

    @Public @Unstable public abstract String getQueue()

  - ### setQueue

    @Public @Unstable public abstract void setQueue(String queue)

  - ### getPolicyManagerClassName

    @Public @Unstable public abstract String getPolicyManagerClassName()

  - ### setPolicyManagerClassName

    @Public @Unstable public abstract void setPolicyManagerClassName(String policyManagerClassName)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`