public class RejectAMRMProxyPolicy extends AbstractAMRMProxyPolicy
FederationAMRMProxyPolicy
that simply
rejects all requests. Useful to prevent apps from accessing any sub-cluster.Constructor and Description |
---|
RejectAMRMProxyPolicy() |
Modifier and Type | Method and Description |
---|---|
void |
notifyOfResponse(SubClusterId subClusterId,
org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse response)
This method should be invoked to notify the policy about responses being
received.
|
void |
reinitialize(FederationPolicyInitializationContext policyContext)
This method is invoked to initialize of update the configuration of
policies.
|
Map<SubClusterId,List<org.apache.hadoop.yarn.api.records.ResourceRequest>> |
splitResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> resourceRequests,
Set<SubClusterId> timedOutSubClusters)
Splits the
ResourceRequest s from the client across one or more
sub-clusters based on the policy semantics (e.g., broadcast, load-based). |
validate
getActiveSubclusters, getIsDirty, getPolicyContext, getPolicyInfo, setPolicyContext, setPolicyInfo
public void reinitialize(FederationPolicyInitializationContext policyContext) throws FederationPolicyInitializationException
ConfigurableFederationPolicy
reinitialize
in interface ConfigurableFederationPolicy
reinitialize
in class AbstractConfigurableFederationPolicy
policyContext
- the new context to provide to implementor.FederationPolicyInitializationException
- in case the initialization
fails.public 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
FederationAMRMProxyPolicy
ResourceRequest
s from the client across one or more
sub-clusters based on the policy semantics (e.g., broadcast, load-based).resourceRequests
- the list of ResourceRequest
s from the AM to
be splittimedOutSubClusters
- the set of sub-clusters that haven't had a
successful heart-beat response for a while.SubClusterId
to the
list of ResourceRequest
s that should be forwarded to itorg.apache.hadoop.yarn.exceptions.YarnException
- in case the request is malformed or no viable
sub-clusters can be found.public void notifyOfResponse(SubClusterId subClusterId, org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse response) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationAMRMProxyPolicy
subClusterId
- the id of the subcluster sending the notificationresponse
- the response received from one of the RMsorg.apache.hadoop.yarn.exceptions.YarnException
- in case the response is not validCopyright © 2022 Apache Software Foundation. All rights reserved.