YARN-11500. Fix typos in hadoop-yarn-server-common#federation. (#5702)
This commit is contained in:
parent
d9980ab40f
commit
fd3c3ae068
@ -22,7 +22,7 @@
|
|||||||
/**
|
/**
|
||||||
* This interface provides a general method to reinitialize a policy. The
|
* This interface provides a general method to reinitialize a policy. The
|
||||||
* semantics are try-n-swap, so in case of an exception is thrown the
|
* semantics are try-n-swap, so in case of an exception is thrown the
|
||||||
* implmentation must ensure the previous state and configuration is preserved.
|
* implementation must ensure the previous state and configuration is preserved.
|
||||||
*/
|
*/
|
||||||
public interface ConfigurableFederationPolicy {
|
public interface ConfigurableFederationPolicy {
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ public static int getWeightedRandom(ArrayList<Float> weights) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// This can only happen if samplePoint is very close to totoalWeight and
|
// This can only happen if samplePoint is very close to totalWeight and
|
||||||
// float rounding kicks in during subtractions
|
// float rounding kicks in during subtractions
|
||||||
return lastIndex;
|
return lastIndex;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ public SubClusterId getHomeSubcluster(
|
|||||||
* This method reinitializes a policy and loads it in the policyMap.
|
* This method reinitializes a policy and loads it in the policyMap.
|
||||||
*
|
*
|
||||||
* @param queue the queue to initialize a policy for.
|
* @param queue the queue to initialize a policy for.
|
||||||
* @param conf the configuration to use for initalization.
|
* @param conf the configuration to use for initialization.
|
||||||
*
|
*
|
||||||
* @throws FederationPolicyInitializationException if initialization fails.
|
* @throws FederationPolicyInitializationException if initialization fails.
|
||||||
*/
|
*/
|
||||||
|
@ -39,7 +39,7 @@ public class RejectAMRMProxyPolicy extends AbstractAMRMProxyPolicy {
|
|||||||
@Override
|
@Override
|
||||||
public void reinitialize(FederationPolicyInitializationContext policyContext)
|
public void reinitialize(FederationPolicyInitializationContext policyContext)
|
||||||
throws FederationPolicyInitializationException {
|
throws FederationPolicyInitializationException {
|
||||||
// overrides initialize to avoid weight checks that do no apply for
|
// overrides initialize to avoid weight checks that do not apply for
|
||||||
// this policy.
|
// this policy.
|
||||||
FederationPolicyInitializationContextValidator.validate(policyContext,
|
FederationPolicyInitializationContextValidator.validate(policyContext,
|
||||||
this.getClass().getCanonicalName());
|
this.getClass().getCanonicalName());
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
import com.sun.jersey.api.json.JSONUnmarshaller;
|
import com.sun.jersey.api.json.JSONUnmarshaller;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a DAO class for the configuration of parameteres for federation
|
* This is a DAO class for the configuration of parameters for federation
|
||||||
* policies. This generalizes several possible configurations as two lists of
|
* policies. This generalizes several possible configurations as two lists of
|
||||||
* {@link SubClusterIdInfo} and corresponding weights as a {@link Float}. The
|
* {@link SubClusterIdInfo} and corresponding weights as a {@link Float}. The
|
||||||
* interpretation of the weight is left to the logic in the policy.
|
* interpretation of the weight is left to the logic in the policy.
|
||||||
@ -85,7 +85,7 @@ private static JSONJAXBContext initContext() {
|
|||||||
*
|
*
|
||||||
* @return the {@link WeightedPolicyInfo} represented.
|
* @return the {@link WeightedPolicyInfo} represented.
|
||||||
*
|
*
|
||||||
* @throws FederationPolicyInitializationException if a deserializaiton error
|
* @throws FederationPolicyInitializationException if a deserialization error
|
||||||
* occurs.
|
* occurs.
|
||||||
*/
|
*/
|
||||||
public static WeightedPolicyInfo fromByteBuffer(ByteBuffer bb)
|
public static WeightedPolicyInfo fromByteBuffer(ByteBuffer bb)
|
||||||
|
@ -25,14 +25,14 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Implementors need to provide the ability to serliaze a policy and its
|
* Implementors need to provide the ability to serialize a policy and its
|
||||||
* configuration as a {@link SubClusterPolicyConfiguration}, as well as provide
|
* configuration as a {@link SubClusterPolicyConfiguration}, as well as provide
|
||||||
* (re)initialization mechanics for the underlying
|
* (re)initialization mechanics for the underlying
|
||||||
* {@link FederationAMRMProxyPolicy} and {@link FederationRouterPolicy}.
|
* {@link FederationAMRMProxyPolicy} and {@link FederationRouterPolicy}.
|
||||||
*
|
*
|
||||||
* The serialization aspects are used by admin APIs or a policy engine to store
|
* The serialization aspects are used by admin APIs or a policy engine to store
|
||||||
* a serialized configuration in the {@code FederationStateStore}, while the
|
* a serialized configuration in the {@code FederationStateStore}, while the
|
||||||
* getters methods are used to obtain a propertly inizialized policy in the
|
* getters methods are used to obtain a properly initialized policy in the
|
||||||
* {@code Router} and {@code AMRMProxy} respectively.
|
* {@code Router} and {@code AMRMProxy} respectively.
|
||||||
*
|
*
|
||||||
* This interface by design binds together {@link FederationAMRMProxyPolicy} and
|
* This interface by design binds together {@link FederationAMRMProxyPolicy} and
|
||||||
@ -71,14 +71,14 @@ FederationAMRMProxyPolicy getAMRMPolicy(
|
|||||||
* context, otherwise a new instance initialized with the current context is
|
* context, otherwise a new instance initialized with the current context is
|
||||||
* provided. If the instance is compatible with the current class the
|
* provided. If the instance is compatible with the current class the
|
||||||
* implementors should attempt to reinitalize (retaining state). To affect a
|
* implementors should attempt to reinitalize (retaining state). To affect a
|
||||||
* complete policy reset oldInstance shoulb be set to null.
|
* complete policy reset oldInstance should be set to null.
|
||||||
*
|
*
|
||||||
* @param policyContext the current context
|
* @param policyContext the current context
|
||||||
* @param oldInstance the existing (possibly null) instance.
|
* @param oldInstance the existing (possibly null) instance.
|
||||||
*
|
*
|
||||||
* @return an updated {@link FederationRouterPolicy}.
|
* @return an updated {@link FederationRouterPolicy}.
|
||||||
*
|
*
|
||||||
* @throws FederationPolicyInitializationException if the initalization cannot
|
* @throws FederationPolicyInitializationException if the initialization cannot
|
||||||
* be completed properly. The oldInstance should be still valid in
|
* be completed properly. The oldInstance should be still valid in
|
||||||
* case of failed initialization.
|
* case of failed initialization.
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* This class represents a simple implementation of a {@code
|
* This class represents a simple implementation of a {@code
|
||||||
* FederationPolicyManager}.
|
* FederationPolicyManager}.
|
||||||
*
|
*
|
||||||
* This policy rejects all reuqests for both router and amrmproxy routing. This
|
* This policy rejects all requests for both router and amrmproxy routing. This
|
||||||
* is to be used to prevent applications in a specific queue (or if used as
|
* is to be used to prevent applications in a specific queue (or if used as
|
||||||
* default for non-configured queues) from accessing cluster resources.
|
* default for non-configured queues) from accessing cluster resources.
|
||||||
*/
|
*/
|
||||||
|
@ -116,7 +116,7 @@ protected Map<SubClusterId, SubClusterInfo> prefilterSubClusters(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Simply picks from alphabetically-sorted active subclusters based on the
|
* Simply picks from alphabetically-sorted active subclusters based on the
|
||||||
* hash of quey name. Jobs of the same queue will all be routed to the same
|
* hash of query name. Jobs of the same queue will all be routed to the same
|
||||||
* sub-cluster, as far as the number of active sub-cluster and their names
|
* sub-cluster, as far as the number of active sub-cluster and their names
|
||||||
* remain the same.
|
* remain the same.
|
||||||
*
|
*
|
||||||
|
@ -816,7 +816,7 @@ protected SubClusterId getSubClusterForUnResolvedRequest(
|
|||||||
// The randomly selected sub-cluster should at least be active
|
// The randomly selected sub-cluster should at least be active
|
||||||
Assert.assertTrue(activeClusters.containsKey(originalResult));
|
Assert.assertTrue(activeClusters.containsKey(originalResult));
|
||||||
|
|
||||||
// Alwasy use home sub-cluster so that unit test is deterministic
|
// Always use home sub-cluster so that unit test is deterministic
|
||||||
return getHomeSubCluster();
|
return getHomeSubCluster();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple test class for the {@link WeightedRandomRouterPolicy}. Generate large
|
* Simple test class for the {@link WeightedRandomRouterPolicy}. Generate large
|
||||||
* number of randomized tests to check we are weighiting correctly even if
|
* number of randomized tests to check we are weighting correctly even if
|
||||||
* clusters go inactive.
|
* clusters go inactive.
|
||||||
*/
|
*/
|
||||||
public class TestWeightedRandomRouterPolicy extends BaseRouterPoliciesTest {
|
public class TestWeightedRandomRouterPolicy extends BaseRouterPoliciesTest {
|
||||||
|
Loading…
Reference in New Issue
Block a user