Class RouterPolicyFacade
java.lang.Object
org.apache.hadoop.yarn.server.federation.policies.RouterPolicyFacade
This class provides a facade to the policy subsystem, and handles the
lifecycle of policies (e.g., refresh from remote, default behaviors etc.).
-
Constructor Summary
ConstructorsConstructorDescriptionRouterPolicyFacade(org.apache.hadoop.conf.Configuration conf, FederationStateStoreFacade facade, SubClusterResolver resolver, SubClusterId homeSubcluster) -
Method Summary
Modifier and TypeMethodDescriptiongetHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters) This method provides a wrapper of all policy functionalities for routing .getReservationHomeSubCluster(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest request) This method provides a wrapper of all policy functionalities for routing a reservation.voidreset()This method flushes all cached configurations and policies.
-
Constructor Details
-
RouterPolicyFacade
public RouterPolicyFacade(org.apache.hadoop.conf.Configuration conf, FederationStateStoreFacade facade, SubClusterResolver resolver, SubClusterId homeSubcluster) throws FederationPolicyInitializationException
-
-
Method Details
-
getHomeSubcluster
public SubClusterId getHomeSubcluster(org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext appSubmissionContext, List<SubClusterId> blackListSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException This method provides a wrapper of all policy functionalities for routing . Internally it manages configuration changes, and policy init/reinit.- 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 there are issues initializing policies, or no valid sub-cluster id could be found for this app.
-
reset
public void reset()This method flushes all cached configurations and policies. This should be invoked if the facade remains activity after very large churn of queues in the system. -
getReservationHomeSubCluster
public SubClusterId getReservationHomeSubCluster(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException This method provides a wrapper of all policy functionalities for routing a reservation. Internally it manages configuration changes, and policy init/reinit.- Parameters:
request- the reservation to route.- Returns:
- the id of the subcluster that will be the "home" for this reservation.
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- if there are issues initializing policies, or no valid sub-cluster id could be found for this reservation.
-