Class SQLFederationStateStore

java.lang.Object
org.apache.hadoop.yarn.server.federation.store.impl.SQLFederationStateStore
All Implemented Interfaces:
FederationApplicationHomeSubClusterStore, FederationDelegationTokenStateStore, FederationMembershipStateStore, FederationPolicyStore, FederationReservationHomeSubClusterStore, FederationStateStore

public class SQLFederationStateStore extends Object implements FederationStateStore
SQL implementation of FederationStateStore.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
    • CALL_SP_ADD_RESERVATION_HOME_SUBCLUSTER

      protected static final String CALL_SP_ADD_RESERVATION_HOME_SUBCLUSTER
      See Also:
    • CALL_SP_GET_RESERVATION_HOME_SUBCLUSTER

      protected static final String CALL_SP_GET_RESERVATION_HOME_SUBCLUSTER
      See Also:
    • CALL_SP_GET_RESERVATIONS_HOME_SUBCLUSTER

      protected static final String CALL_SP_GET_RESERVATIONS_HOME_SUBCLUSTER
      See Also:
    • CALL_SP_DELETE_RESERVATION_HOME_SUBCLUSTER

      protected static final String CALL_SP_DELETE_RESERVATION_HOME_SUBCLUSTER
      See Also:
    • CALL_SP_UPDATE_RESERVATION_HOME_SUBCLUSTER

      protected static final String CALL_SP_UPDATE_RESERVATION_HOME_SUBCLUSTER
      See Also:
    • CALL_SP_ADD_MASTERKEY

      protected static final String CALL_SP_ADD_MASTERKEY
      See Also:
    • CALL_SP_GET_MASTERKEY

      protected static final String CALL_SP_GET_MASTERKEY
      See Also:
    • CALL_SP_DELETE_MASTERKEY

      protected static final String CALL_SP_DELETE_MASTERKEY
      See Also:
    • CALL_SP_ADD_DELEGATIONTOKEN

      protected static final String CALL_SP_ADD_DELEGATIONTOKEN
      See Also:
    • CALL_SP_GET_DELEGATIONTOKEN

      protected static final String CALL_SP_GET_DELEGATIONTOKEN
      See Also:
    • CALL_SP_UPDATE_DELEGATIONTOKEN

      protected static final String CALL_SP_UPDATE_DELEGATIONTOKEN
      See Also:
    • CALL_SP_DELETE_DELEGATIONTOKEN

      protected static final String CALL_SP_DELETE_DELEGATIONTOKEN
      See Also:
    • CURRENT_VERSION_INFO

      protected static final Version CURRENT_VERSION_INFO
  • Constructor Details

    • SQLFederationStateStore

      public SQLFederationStateStore()
  • Method Details

    • init

      public void init(org.apache.hadoop.conf.Configuration conf) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationStateStore
      Initialize the FederationStore.
      Specified by:
      init in interface FederationStateStore
      Parameters:
      conf - the cluster configuration
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if initialization fails
    • registerSubCluster

      public SubClusterRegisterResponse registerSubCluster(SubClusterRegisterRequest registerSubClusterRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationMembershipStateStore
      Register a subcluster by publishing capabilities as represented by SubClusterInfo to indicate participation in federation. This is typically done during initialization or restart/failover of the subcluster's ResourceManager. Upon successful registration, an identifier for the subcluster which is unique across the federated cluster is returned. The identifier is static, i.e. preserved across restarts and failover.
      Specified by:
      registerSubCluster in interface FederationMembershipStateStore
      Parameters:
      registerSubClusterRequest - the capabilities of the subcluster that wants to participate in federation. The subcluster id is also specified in case registration is triggered by restart/failover
      Returns:
      response empty on successfully if registration was successful
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • deregisterSubCluster

      public SubClusterDeregisterResponse deregisterSubCluster(SubClusterDeregisterRequest subClusterDeregisterRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationMembershipStateStore
      Deregister a subcluster identified by SubClusterId to change state in federation. This can be done to mark the sub cluster lost, deregistered, or decommissioned.
      Specified by:
      deregisterSubCluster in interface FederationMembershipStateStore
      Parameters:
      subClusterDeregisterRequest - - the request to deregister the sub-cluster from federation.
      Returns:
      response empty on successfully deregistering the subcluster state
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • subClusterHeartbeat

      public SubClusterHeartbeatResponse subClusterHeartbeat(SubClusterHeartbeatRequest subClusterHeartbeatRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationMembershipStateStore
      Periodic heartbeat from a ResourceManager participating in federation to indicate liveliness. The heartbeat publishes the current capabilities as represented by SubClusterInfo of the subcluster. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.
      Specified by:
      subClusterHeartbeat in interface FederationMembershipStateStore
      Parameters:
      subClusterHeartbeatRequest - the capabilities of the subcluster that wants to keep alive its participation in federation
      Returns:
      response currently empty on if heartbeat was successfully processed
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getSubCluster

      public GetSubClusterInfoResponse getSubCluster(GetSubClusterInfoRequest subClusterRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationMembershipStateStore
      Get the membership information of subcluster as identified by SubClusterId. The membership information includes the cluster endpoint and current capabilities as represented by SubClusterInfo.
      Specified by:
      getSubCluster in interface FederationMembershipStateStore
      Parameters:
      subClusterRequest - the subcluster whose information is required
      Returns:
      the SubClusterInfo, or null if there is no mapping for the subcluster
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getSubClusters

      public GetSubClustersInfoResponse getSubClusters(GetSubClustersInfoRequest subClustersRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationMembershipStateStore
      Get the membership information of all the subclusters that are currently participating in federation. The membership information includes the cluster endpoint and current capabilities as represented by SubClusterInfo.
      Specified by:
      getSubClusters in interface FederationMembershipStateStore
      Parameters:
      subClustersRequest - request for sub-clusters information
      Returns:
      a map of SubClusterInfo keyed by the SubClusterId
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • addApplicationHomeSubCluster

      public AddApplicationHomeSubClusterResponse addApplicationHomeSubCluster(AddApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationApplicationHomeSubClusterStore
      Register the home SubClusterId of the newly submitted ApplicationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure. If a mapping for the application already existed, the SubClusterId in this response will return the existing mapping which might be different from that in the AddApplicationHomeSubClusterRequest.
      Specified by:
      addApplicationHomeSubCluster in interface FederationApplicationHomeSubClusterStore
      Parameters:
      request - the request to register a new application with its home sub-cluster
      Returns:
      upon successful registration of the application in the StateStore, AddApplicationHomeSubClusterRequest containing the home sub-cluster of the application. Otherwise, an exception reporting reason for a failure
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • updateApplicationHomeSubCluster

      public UpdateApplicationHomeSubClusterResponse updateApplicationHomeSubCluster(UpdateApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationApplicationHomeSubClusterStore
      Update the home SubClusterId of a previously submitted ApplicationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.
      Specified by:
      updateApplicationHomeSubCluster in interface FederationApplicationHomeSubClusterStore
      Parameters:
      request - the request to update the home sub-cluster of an application.
      Returns:
      empty on successful update of the application in the StateStore, if not an exception reporting reason for a failure
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getApplicationHomeSubCluster

      public GetApplicationHomeSubClusterResponse getApplicationHomeSubCluster(GetApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationApplicationHomeSubClusterStore
      Get information about the application identified by the input ApplicationId.
      Specified by:
      getApplicationHomeSubCluster in interface FederationApplicationHomeSubClusterStore
      Parameters:
      request - contains the application queried
      Returns:
      ApplicationHomeSubCluster containing the application's home subcluster
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getApplicationsHomeSubCluster

      public GetApplicationsHomeSubClusterResponse getApplicationsHomeSubCluster(GetApplicationsHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationApplicationHomeSubClusterStore
      Get the ApplicationHomeSubCluster list representing the mapping of all submitted applications to it's home sub-cluster.
      Specified by:
      getApplicationsHomeSubCluster in interface FederationApplicationHomeSubClusterStore
      Parameters:
      request - empty representing all applications
      Returns:
      the mapping of all submitted application to it's home sub-cluster
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • deleteApplicationHomeSubCluster

      public DeleteApplicationHomeSubClusterResponse deleteApplicationHomeSubCluster(DeleteApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationApplicationHomeSubClusterStore
      Delete the mapping of home SubClusterId of a previously submitted ApplicationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.
      Specified by:
      deleteApplicationHomeSubCluster in interface FederationApplicationHomeSubClusterStore
      Parameters:
      request - the request to delete the home sub-cluster of an application.
      Returns:
      empty on successful update of the application in the StateStore, if not an exception reporting reason for a failure
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getPolicyConfiguration

      public GetSubClusterPolicyConfigurationResponse getPolicyConfiguration(GetSubClusterPolicyConfigurationRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationPolicyStore
      Get the policy configuration for a given queue.
      Specified by:
      getPolicyConfiguration in interface FederationPolicyStore
      Parameters:
      request - the queue whose SubClusterPolicyConfiguration is required
      Returns:
      the SubClusterPolicyConfiguration for the specified queue, or null if there is no mapping for the queue
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • setPolicyConfiguration

      public SetSubClusterPolicyConfigurationResponse setPolicyConfiguration(SetSubClusterPolicyConfigurationRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationPolicyStore
      Set the policy configuration for a given queue.
      Specified by:
      setPolicyConfiguration in interface FederationPolicyStore
      Parameters:
      request - the SubClusterPolicyConfiguration with the corresponding queue
      Returns:
      response empty on successfully updating the SubClusterPolicyConfiguration for the specified queue
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getPoliciesConfigurations

      public GetSubClusterPoliciesConfigurationsResponse getPoliciesConfigurations(GetSubClusterPoliciesConfigurationsRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationPolicyStore
      Get a map of all queue-to-policy configurations.
      Specified by:
      getPoliciesConfigurations in interface FederationPolicyStore
      Parameters:
      request - empty to represent all configured queues in the system
      Returns:
      the policies for all currently active queues in the system
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • deletePoliciesConfigurations

      public DeleteSubClusterPoliciesConfigurationsResponse deletePoliciesConfigurations(DeleteSubClusterPoliciesConfigurationsRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationPolicyStore
      Delete PoliciesConfigurations.
      Specified by:
      deletePoliciesConfigurations in interface FederationPolicyStore
      Parameters:
      request - List containing delete queues.
      Returns:
      response empty means the queue list has been deleted successfully.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • deleteAllPoliciesConfigurations

      public DeletePoliciesConfigurationsResponse deleteAllPoliciesConfigurations(DeletePoliciesConfigurationsRequest request) throws Exception
      Description copied from interface: FederationPolicyStore
      Delete all queue-to-policy configurations.
      Specified by:
      deleteAllPoliciesConfigurations in interface FederationPolicyStore
      Parameters:
      request - delete request.
      Returns:
      If the response is empty, the queue-to-policy configurations are deleted successfully.
      Throws:
      Exception - if the request is invalid/fails
    • getCurrentVersion

      public Version getCurrentVersion()
      Description copied from interface: FederationStateStore
      Get the Version of the underlying federation state store client.
      Specified by:
      getCurrentVersion in interface FederationStateStore
      Returns:
      the Version of the underlying federation store client
    • loadVersion

      public Version loadVersion() throws Exception
      Description copied from interface: FederationStateStore
      Load the version information from the federation state store.
      Specified by:
      loadVersion in interface FederationStateStore
      Returns:
      the Version of the federation state store
      Throws:
      Exception - an exception occurred in load version.
    • getVersion

      public Version getVersion() throws Exception
      Query the Version information of Federation from the database.
      Returns:
      Version Info.
      Throws:
      Exception - Exception Information.
    • storeVersion

      public void storeVersion() throws Exception
      Description copied from interface: FederationStateStore
      Store the Version information in federation state store.
      Specified by:
      storeVersion in interface FederationStateStore
      Throws:
      Exception - an exception occurred in store version.
    • deleteStateStore

      public void deleteStateStore() throws Exception
      Description copied from interface: FederationStateStore
      We will clear the data in stateStore through the deleteStateStore method.
      Specified by:
      deleteStateStore in interface FederationStateStore
      Throws:
      Exception - an exception occurred in delete store.
    • storeVersion

      public void storeVersion(byte[] fedVersion, String versionComment) throws org.apache.hadoop.yarn.exceptions.YarnException
      Store the Federation Version in the database.
      Parameters:
      fedVersion - Federation Version.
      versionComment - Federation Version Comment, We use the result of Version toString as version Comment.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - indicates exceptions from yarn servers.
    • close

      public void close() throws Exception
      Description copied from interface: FederationStateStore
      Perform any cleanup operations of the StateStore.
      Specified by:
      close in interface FederationStateStore
      Throws:
      Exception - if cleanup fails
    • getConnection

      @VisibleForTesting protected Connection getConnection() throws SQLException
      Get a connection from the DataSource pool.
      Returns:
      a connection from the DataSource pool.
      Throws:
      SQLException - on failure
    • getConnection

      protected Connection getConnection(boolean isCommitted) throws SQLException
      Get a connection from the DataSource pool.
      Parameters:
      isCommitted - Whether to enable automatic transaction commit. If set to true, turn on transaction autocommit, if set to false, turn off transaction autocommit.
      Returns:
      a connection from the DataSource pool.
      Throws:
      SQLException - on failure.
    • getCallableStatement

      @VisibleForTesting protected CallableStatement getCallableStatement(String procedure) throws SQLException
      Throws:
      SQLException
    • addReservationHomeSubCluster

      public AddReservationHomeSubClusterResponse addReservationHomeSubCluster(AddReservationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationReservationHomeSubClusterStore
      Register the home SubClusterId of the newly submitted ReservationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure. If a mapping for the Reservation already existed, the SubClusterId in this response will return the existing mapping which might be different from that in the AddReservationHomeSubClusterRequest.
      Specified by:
      addReservationHomeSubCluster in interface FederationReservationHomeSubClusterStore
      Parameters:
      request - the request to register a new Reservation with its home sub-cluster
      Returns:
      upon successful registration of the Reservation in the StateStore, AddReservationHomeSubClusterRequest containing the home sub-cluster of the Reservation. Otherwise, an exception reporting reason for a failure
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getReservationHomeSubCluster

      public GetReservationHomeSubClusterResponse getReservationHomeSubCluster(GetReservationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationReservationHomeSubClusterStore
      Get information about the Reservation identified by the input ReservationId.
      Specified by:
      getReservationHomeSubCluster in interface FederationReservationHomeSubClusterStore
      Parameters:
      request - contains the Reservation queried
      Returns:
      ReservationHomeSubCluster containing the Reservation's home subcluster
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getReservationsHomeSubCluster

      public GetReservationsHomeSubClusterResponse getReservationsHomeSubCluster(GetReservationsHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationReservationHomeSubClusterStore
      Get the ReservationHomeSubCluster list representing the mapping of all submitted Reservations to it's home sub-cluster.
      Specified by:
      getReservationsHomeSubCluster in interface FederationReservationHomeSubClusterStore
      Parameters:
      request - empty representing all Reservations
      Returns:
      the mapping of all submitted Reservation to it's home sub-cluster
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • deleteReservationHomeSubCluster

      public DeleteReservationHomeSubClusterResponse deleteReservationHomeSubCluster(DeleteReservationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationReservationHomeSubClusterStore
      Delete the mapping of home SubClusterId of a previously submitted ReservationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.
      Specified by:
      deleteReservationHomeSubCluster in interface FederationReservationHomeSubClusterStore
      Parameters:
      request - the request to delete the home sub-cluster of a reservation.
      Returns:
      empty on successful update of the Reservation in the StateStore, if not an exception reporting reason for a failure
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • updateReservationHomeSubCluster

      public UpdateReservationHomeSubClusterResponse updateReservationHomeSubCluster(UpdateReservationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException
      Description copied from interface: FederationReservationHomeSubClusterStore
      Update the home SubClusterId of a previously submitted ReservationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.
      Specified by:
      updateReservationHomeSubCluster in interface FederationReservationHomeSubClusterStore
      Parameters:
      request - the request to update the home sub-cluster of a reservation.
      Returns:
      empty on successful update of the Reservation in the StateStore, if not an exception reporting reason for a failure
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the request is invalid/fails
    • getConn

      @VisibleForTesting public Connection getConn()
    • storeNewMasterKey

      public RouterMasterKeyResponse storeNewMasterKey(RouterMasterKeyRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      SQLFederationStateStore Supports Store New MasterKey.
      Specified by:
      storeNewMasterKey in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterMasterKey, which is an abstraction for DelegationKey.
      Returns:
      routerMasterKeyResponse, the response contains the RouterMasterKey.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • removeStoredMasterKey

      public RouterMasterKeyResponse removeStoredMasterKey(RouterMasterKeyRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      SQLFederationStateStore Supports Remove MasterKey. Defined the sp_deleteMasterKey procedure. This procedure requires 1 input parameters, 1 output parameters. Input parameters 1. IN keyId_IN int Output parameters 2. OUT rowCount_OUT int
      Specified by:
      removeStoredMasterKey in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterMasterKey, which is an abstraction for DelegationKey
      Returns:
      routerMasterKeyResponse, the response contains the RouterMasterKey.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • getMasterKeyByDelegationKey

      public RouterMasterKeyResponse getMasterKeyByDelegationKey(RouterMasterKeyRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      SQLFederationStateStore Supports Remove MasterKey. Defined the sp_getMasterKey procedure. this procedure requires 2 parameters. Input parameters: 1. IN keyId_IN int Output parameters: 2. OUT masterKey_OUT varchar(1024)
      Specified by:
      getMasterKeyByDelegationKey in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterMasterKey, which is an abstraction for DelegationKey
      Returns:
      routerMasterKeyResponse, the response contains the RouterMasterKey.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • storeNewToken

      public RouterRMTokenResponse storeNewToken(RouterRMTokenRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      SQLFederationStateStore Supports Store RMDelegationTokenIdentifier. Defined the sp_addDelegationToken procedure. This procedure requires 4 input parameters, 1 output parameters. Input parameters: 1. IN sequenceNum_IN int 2. IN tokenIdent_IN varchar(1024) 3. IN token_IN varchar(1024) 4. IN renewDate_IN bigint Output parameters: 5. OUT rowCount_OUT int
      Specified by:
      storeNewToken in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterRMToken (RMDelegationTokenIdentifier and renewDate)
      Returns:
      routerRMTokenResponse, the response contains the RouterStoreToken.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • updateStoredToken

      public RouterRMTokenResponse updateStoredToken(RouterRMTokenRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      SQLFederationStateStore Supports Update RMDelegationTokenIdentifier. Defined the sp_updateDelegationToken procedure. This procedure requires 4 input parameters, 1 output parameters. Input parameters: 1. IN sequenceNum_IN int 2. IN tokenIdent_IN varchar(1024) 3. IN token_IN varchar(1024) 4. IN renewDate_IN bigint Output parameters: 5. OUT rowCount_OUT int
      Specified by:
      updateStoredToken in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterRMToken (RMDelegationTokenIdentifier and renewDate)
      Returns:
      routerRMTokenResponse, the response contains the RouterStoreToken.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • removeStoredToken

      public RouterRMTokenResponse removeStoredToken(RouterRMTokenRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      SQLFederationStateStore Supports Remove RMDelegationTokenIdentifier. Defined the sp_deleteDelegationToken procedure. This procedure requires 1 input parameters, 1 output parameters. Input parameters: 1. IN sequenceNum_IN bigint Output parameters: 2. OUT rowCount_OUT int
      Specified by:
      removeStoredToken in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterRMToken (RMDelegationTokenIdentifier and renewDate)
      Returns:
      routerRMTokenResponse, the response contains the RouterStoreToken.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • getTokenByRouterStoreToken

      public RouterRMTokenResponse getTokenByRouterStoreToken(RouterRMTokenRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
      The Router Supports GetTokenByRouterStoreToken.
      Specified by:
      getTokenByRouterStoreToken in interface FederationDelegationTokenStateStore
      Parameters:
      request - The request contains RouterRMToken (RMDelegationTokenIdentifier and renewDate)
      Returns:
      RouterRMTokenResponse.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - if the call to the state store is unsuccessful.
      IOException - An IO Error occurred.
    • incrementDelegationTokenSeqNum

      public int incrementDelegationTokenSeqNum()
      Increment DelegationToken SeqNum.
      Specified by:
      incrementDelegationTokenSeqNum in interface FederationDelegationTokenStateStore
      Returns:
      delegationTokenSeqNum.
    • getDelegationTokenSeqNum

      public int getDelegationTokenSeqNum()
      Get DelegationToken SeqNum.
      Specified by:
      getDelegationTokenSeqNum in interface FederationDelegationTokenStateStore
      Returns:
      delegationTokenSeqNum.
    • setDelegationTokenSeqNum

      public void setDelegationTokenSeqNum(int seqNum)
      Description copied from interface: FederationDelegationTokenStateStore
      The Router Supports setDelegationTokenSeqNum.
      Specified by:
      setDelegationTokenSeqNum in interface FederationDelegationTokenStateStore
      Parameters:
      seqNum - DelegationTokenSeqNum.
    • getCurrentKeyId

      public int getCurrentKeyId()
      Get Current KeyId.
      Specified by:
      getCurrentKeyId in interface FederationDelegationTokenStateStore
      Returns:
      currentKeyId.
    • incrementCurrentKeyId

      public int incrementCurrentKeyId()
      The Router Supports incrementCurrentKeyId.
      Specified by:
      incrementCurrentKeyId in interface FederationDelegationTokenStateStore
      Returns:
      CurrentKeyId.
    • getDataSource

      @VisibleForTesting public com.zaxxer.hikari.HikariDataSource getDataSource()