Interface FederationRouterPolicy
- All Superinterfaces:
ConfigurableFederationPolicy
- All Known Implementing Classes:
AbstractRouterPolicy,HashBasedRouterPolicy,LoadBasedRouterPolicy,LocalityRouterPolicy,PriorityRouterPolicy,RejectRouterPolicy,UniformRandomRouterPolicy,WeightedRandomRouterPolicy
Implements the logic for determining the routing of an application submission
based on a policy.
-
Method Summary
Modifier and TypeMethodDescriptiongetHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters) Determines the sub-cluster that the user application submission should be routed to.getReservationHomeSubcluster(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest request) Determines the sub-cluster where a ReservationSubmissionRequest should be sent to.Methods inherited from interface org.apache.hadoop.yarn.server.federation.policies.ConfigurableFederationPolicy
reinitialize
-
Method Details
-
getHomeSubcluster
SubClusterId getHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException Determines the sub-cluster that the user application submission should be routed to.- Parameters:
appSubmissionContext- theApplicationSubmissionContextthat has to be routed to an appropriate subCluster for execution.blackListSubClusters- the list of subClusters as identified bySubClusterIdto blackList from the selection of the home subCluster.- Returns:
- the
SubClusterIdthat will be the "home" for this application. - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the policy cannot determine a viable subcluster.
-
getReservationHomeSubcluster
SubClusterId getReservationHomeSubcluster(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException Determines the sub-cluster where a ReservationSubmissionRequest should be sent to.- Parameters:
request- the original request- Returns:
- a mapping of sub-clusters and the requests
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if the policy fails to choose a sub-cluster
-