Class RegisterApplicationMasterRequest
java.lang.Object
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringgetHost()Get the host on which theApplicationMasteris running.Return all Placement Constraints specified at the Application level.abstract intGet the RPC port on which theApplicationMasteris responding.abstract StringGet the tracking URL for theApplicationMaster.newInstance(String host, int port, String trackingUrl) Create a new instance ofRegisterApplicationMasterRequest.abstract voidSet the host on which theApplicationMasteris running.voidsetPlacementConstraints(Map<Set<String>, PlacementConstraint> placementConstraints) Set Placement Constraints applicable to theSchedulingRequests of this application.abstract voidsetRpcPort(int port) Set the RPC port on which theApplicationMasteris responding.abstract voidsetTrackingUrl(String trackingUrl) Set the tracking URLfor theApplicationMasterwhile it is running.
-
Constructor Details
-
RegisterApplicationMasterRequest
public RegisterApplicationMasterRequest()
-
-
Method Details
-
newInstance
@Public @Stable public static RegisterApplicationMasterRequest newInstance(String host, int port, String trackingUrl) Create a new instance ofRegisterApplicationMasterRequest. If port, trackingUrl is not used, use the following default value:- port: -1
- trackingUrl: null
- Parameters:
host- host on which the ApplicationMaster is running.port- the RPC port on which the ApplicationMaster is responding.trackingUrl- tracking URL for the ApplicationMaster.- Returns:
- the new instance of
RegisterApplicationMasterRequest
-
getHost
Get the host on which theApplicationMasteris running.- Returns:
- host on which the
ApplicationMasteris running
-
setHost
Set the host on which theApplicationMasteris running.- Parameters:
host- host on which theApplicationMasteris running
-
getRpcPort
@Public @Stable public abstract int getRpcPort()Get the RPC port on which theApplicationMasteris responding.- Returns:
- the RPC port on which the
ApplicationMasteris responding
-
setRpcPort
@Public @Stable public abstract void setRpcPort(int port) Set the RPC port on which theApplicationMasteris responding.- Parameters:
port- RPC port on which theApplicationMasteris responding
-
getTrackingUrl
Get the tracking URL for theApplicationMaster. 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
Set the tracking URLfor theApplicationMasterwhile it is running. This is the web-URL to which ResourceManager or web-application proxy will redirect client/users while the application and theApplicationMasterare 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 theApplicationMaster
-
getPlacementConstraints
Return all Placement Constraints specified at the Application level. The mapping is from a set of allocation tags to aPlacementConstraintassociated with the tags, i.e., eachSchedulingRequestthat has those tags will be placed taking into account the corresponding constraint.- Returns:
- A map of Placement Constraints.
-
setPlacementConstraints
@Public @Unstable public void setPlacementConstraints(Map<Set<String>, PlacementConstraint> placementConstraints) Set Placement Constraints applicable to theSchedulingRequests of this application. The mapping is from a set of allocation tags to aPlacementConstraintassociated with the tags. For example: Map < <hb_regionserver> -> node_anti_affinity, <hb_regionserver, hb_master> -> rack_affinity, ... >- Parameters:
placementConstraints- Placement Constraint Mapping.
-