org.apache.hadoop.yarn.api.protocolrecords

## Class RegisterApplicationMasterRequest

- java.lang.Object
- - org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest

-     @InterfaceAudience.Public
       @InterfaceStability.Stable
      public abstract class RegisterApplicationMasterRequest
      extends Object

  The request sent by the `ApplicationMaster` to `ResourceManager` on registration.

  The registration includes details such as:

  - Hostname on which the AM is running.
  - RPC Port
  - Tracking URL
  See Also:
    `ApplicationMasterProtocol.registerApplicationMaster(RegisterApplicationMasterRequest)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegisterApplicationMasterRequest()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract String` | `getHost()` Get the host on which the `ApplicationMaster` is running.
    `Map<Set<String>,PlacementConstraint>` | `getPlacementConstraints()` Return all Placement Constraints specified at the Application level.
    `abstract int` | `getRpcPort()` Get the RPC port on which the `ApplicationMaster` is responding.
    `abstract String` | `getTrackingUrl()` Get the tracking URL for the `ApplicationMaster`.
    `static RegisterApplicationMasterRequest` | `newInstance(String host, int port, String trackingUrl)` Create a new instance of `RegisterApplicationMasterRequest`.
    `abstract void` | `setHost(String host)` Set the host on which the `ApplicationMaster` is running.
    `void` | `setPlacementConstraints(Map<Set<String>,PlacementConstraint> placementConstraints)` Set Placement Constraints applicable to the `SchedulingRequest`s of this application.
    `abstract void` | `setRpcPort(int port)` Set the RPC port on which the `ApplicationMaster` is responding.
    `abstract void` | `setTrackingUrl(String trackingUrl)` Set the tracking URLfor the `ApplicationMaster` while it is running.

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

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

- - ### Constructor Detail

    - #### RegisterApplicationMasterRequest

          public RegisterApplicationMasterRequest()

  - ### Method Detail

    - #### newInstance

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public static RegisterApplicationMasterRequest newInstance(String host,
                                                                                                                           int port,
                                                                                                                           String trackingUrl)

      Create a new instance of `RegisterApplicationMasterRequest`. If port, trackingUrl is not used, use the following default value:
      - port: -1
      - trackingUrl: null
      The port is allowed to be any integer larger than or equal to -1.
      Returns:
        the new instance of `RegisterApplicationMasterRequest`

    - #### getHost

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract String getHost()

      Get the host on which the `ApplicationMaster` is running.
      Returns:
        host on which the `ApplicationMaster` is running

    - #### setHost

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setHost(String host)

      Set the host on which the `ApplicationMaster` is running.
      Parameters:
        `host` - host on which the `ApplicationMaster` is running

    - #### getRpcPort

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract int getRpcPort()

      Get the RPC port on which the `ApplicationMaster` is responding.
      Returns:
        the RPC port on which the `ApplicationMaster` is responding

    - #### setRpcPort

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setRpcPort(int port)

      Set the RPC port on which the `ApplicationMaster` is responding.
      Parameters:
        `port` - RPC port on which the `ApplicationMaster` is responding

    - #### getTrackingUrl

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract String getTrackingUrl()

      Get the tracking URL for the `ApplicationMaster`. This url if contains scheme then that will be used by resource manager web application proxy otherwise it will default to http.
      Returns:
        tracking URL for the `ApplicationMaster`

    - #### setTrackingUrl

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setTrackingUrl(String trackingUrl)

      Set the tracking URLfor the `ApplicationMaster` while it is running. This is the web-URL to which ResourceManager or web-application proxy will redirect client/users while the application and the `ApplicationMaster` are still running.

      If the passed url has a scheme then that will be used by the ResourceManager and web-application proxy, otherwise the scheme will default to http.

      Empty, null, "N/A" strings are all valid besides a real URL. In case an url isn't explicitly passed, it defaults to "N/A" on the ResourceManager.

      Parameters:
        `trackingUrl` - tracking URLfor the `ApplicationMaster`

    - #### getPlacementConstraints

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public Map<Set<String>,PlacementConstraint> getPlacementConstraints()

      Return all Placement Constraints specified at the Application level. The mapping is from a set of allocation tags to a `PlacementConstraint` associated with the tags, i.e., each `SchedulingRequest` that has those tags will be placed taking into account the corresponding constraint.
      Returns:
        A map of Placement Constraints.

    - #### setPlacementConstraints

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public void setPlacementConstraints(Map<Set<String>,PlacementConstraint> placementConstraints)

      Set Placement Constraints applicable to the `SchedulingRequest`s of this application. The mapping is from a set of allocation tags to a `PlacementConstraint` associated with the tags. For example: Map < <hb_regionserver> -> node_anti_affinity, <hb_regionserver, hb_master> -> rack_affinity, ... >
      Parameters:
        `placementConstraints` - Placement Constraint Mapping.

Copyright © 2022 Apache Software Foundation. All rights reserved.