org.apache.hadoop.yarn.server.federation.store.utils

## Class FederationMembershipStateStoreInputValidator

- java.lang.Object
- - org.apache.hadoop.yarn.server.federation.store.utils.FederationMembershipStateStoreInputValidator

-     public final class FederationMembershipStateStoreInputValidator
      extends Object

  Utility class to validate the inputs to `FederationMembershipStateStore`, allows a fail fast mechanism for invalid user inputs.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static void` | `checkSubClusterId(SubClusterId subClusterId)` Validate if the SubCluster Id is present or not.
    `static void` | `checkSubClusterInfo(SubClusterInfo subClusterInfo)` Validate if all the required fields on `SubClusterInfo` are present or not.
    `static void` | `validate(GetSubClusterInfoRequest request)` Quick validation on the input to check some obvious fail conditions (fail fast).
    `static void` | `validate(SubClusterDeregisterRequest request)` Quick validation on the input to check some obvious fail conditions (fail fast).
    `static void` | `validate(SubClusterHeartbeatRequest request)` Quick validation on the input to check some obvious fail conditions (fail fast).
    `static void` | `validate(SubClusterRegisterRequest request)` Quick validation on the input to check some obvious fail conditions (fail fast).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### validate

          public static void validate(SubClusterRegisterRequest request)
                               throws FederationStateStoreInvalidInputException

      Quick validation on the input to check some obvious fail conditions (fail fast). Check if the provided `SubClusterRegisterRequest` for registration a new subcluster is valid or not.
      Parameters:
        `request` - the `SubClusterRegisterRequest` to validate against
      Throws:
        `FederationStateStoreInvalidInputException` - if the request is invalid

    - #### validate

          public static void validate(SubClusterDeregisterRequest request)
                               throws FederationStateStoreInvalidInputException

      Quick validation on the input to check some obvious fail conditions (fail fast). Check if the provided `SubClusterDeregisterRequest` for deregistration a subcluster is valid or not.
      Parameters:
        `request` - the `SubClusterDeregisterRequest` to validate against
      Throws:
        `FederationStateStoreInvalidInputException` - if the request is invalid

    - #### validate

          public static void validate(SubClusterHeartbeatRequest request)
                               throws FederationStateStoreInvalidInputException

      Quick validation on the input to check some obvious fail conditions (fail fast). Check if the provided `SubClusterHeartbeatRequest` for heartbeating a subcluster is valid or not.
      Parameters:
        `request` - the `SubClusterHeartbeatRequest` to validate against
      Throws:
        `FederationStateStoreInvalidInputException` - if the request is invalid

    - #### validate

          public static void validate(GetSubClusterInfoRequest request)
                               throws FederationStateStoreInvalidInputException

      Quick validation on the input to check some obvious fail conditions (fail fast). Check if the provided `GetSubClusterInfoRequest` for querying subcluster's information is valid or not.
      Parameters:
        `request` - the `GetSubClusterInfoRequest` to validate against
      Throws:
        `FederationStateStoreInvalidInputException` - if the request is invalid

    - #### checkSubClusterInfo

          public static void checkSubClusterInfo(SubClusterInfo subClusterInfo)
                                          throws FederationStateStoreInvalidInputException

      Validate if all the required fields on `SubClusterInfo` are present or not. `Capability` will be empty as the corresponding `ResourceManager` is in the process of initialization during registration.
      Parameters:
        `subClusterInfo` - the information of the subcluster to be verified
      Throws:
        `FederationStateStoreInvalidInputException` - if the SubCluster Info are invalid

    - #### checkSubClusterId

          protected static void checkSubClusterId(SubClusterId subClusterId)
                                           throws FederationStateStoreInvalidInputException

      Validate if the SubCluster Id is present or not.
      Parameters:
        `subClusterId` - the identifier of the subcluster to be verified
      Throws:
        `FederationStateStoreInvalidInputException` - if the SubCluster Id is invalid

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.