Interface FederationAMRMProxyPolicy
- All Superinterfaces:
ConfigurableFederationPolicy
- All Known Implementing Classes:
AbstractAMRMProxyPolicy,BroadcastAMRMProxyPolicy,HomeAMRMProxyPolicy,LocalityMulticastAMRMProxyPolicy,RejectAMRMProxyPolicy
Implementors of this interface provide logic to split the list of
ResourceRequests received by the AM among various RMs.-
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyOfResponse(SubClusterId subClusterId, org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse response) This method should be invoked to notify the policy about responses being received.Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>> splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests, Set<SubClusterId> timedOutSubClusters) Splits theResourceRequests from the client across one or more sub-clusters based on the policy semantics (e.g., broadcast, load-based).Methods inherited from interface org.apache.hadoop.yarn.server.federation.policies.ConfigurableFederationPolicy
reinitialize
-
Method Details
-
splitResourceRequests
Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>> splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests, Set<SubClusterId> timedOutSubClusters) throws org.apache.hadoop.yarn.exceptions.YarnException Splits theResourceRequests from the client across one or more sub-clusters based on the policy semantics (e.g., broadcast, load-based).- Parameters:
resourceRequests- the list ofResourceRequests from the AM to be splittimedOutSubClusters- the set of sub-clusters that haven't had a successful heart-beat response for a while.- Returns:
- map of sub-cluster as identified by
SubClusterIdto the list ofResourceRequests that should be forwarded to it - Throws:
org.apache.hadoop.yarn.exceptions.YarnException- in case the request is malformed or no viable sub-clusters can be found.
-
notifyOfResponse
void notifyOfResponse(SubClusterId subClusterId, org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse response) throws org.apache.hadoop.yarn.exceptions.YarnException This method should be invoked to notify the policy about responses being received. This is useful for stateful policies that make decisions based on previous responses being received.- Parameters:
subClusterId- the id of the subcluster sending the notificationresponse- the response received from one of the RMs- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- in case the response is not valid
-