Class SQLFederationStateStore
java.lang.Object
org.apache.hadoop.yarn.server.federation.store.impl.SQLFederationStateStore
- All Implemented Interfaces:
FederationApplicationHomeSubClusterStore,FederationDelegationTokenStateStore,FederationMembershipStateStore,FederationPolicyStore,FederationReservationHomeSubClusterStore,FederationStateStore
SQL implementation of
FederationStateStore.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Versionstatic final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRegister the homeSubClusterIdof the newly submittedApplicationId.Register the homeSubClusterIdof the newly submittedReservationId.voidclose()Perform any cleanup operations of the StateStore.Delete all queue-to-policy configurations.Delete the mapping of homeSubClusterIdof a previously submittedApplicationId.Delete PoliciesConfigurations.Delete the mapping of homeSubClusterIdof a previously submittedReservationId.voidWe will clear the data in stateStore through the deleteStateStore method.deregisterSubCluster(SubClusterDeregisterRequest subClusterDeregisterRequest) Deregister a subcluster identified bySubClusterIdto change state in federation.Get information about the application identified by the inputApplicationId.Get theApplicationHomeSubClusterlist representing the mapping of all submitted applications to it's home sub-cluster.protected CallableStatementgetCallableStatement(String procedure) getConn()protected ConnectionGet a connection from the DataSource pool.protected ConnectiongetConnection(boolean isCommitted) Get a connection from the DataSource pool.intGet Current KeyId.Get theVersionof the underlying federation state store client.com.zaxxer.hikari.HikariDataSourceintGet DelegationToken SeqNum.SQLFederationStateStore Supports Remove MasterKey.Get a map of all queue-to-policy configurations.Get the policy configuration for a given queue.Get information about the Reservation identified by the inputReservationId.Get theReservationHomeSubClusterlist representing the mapping of all submitted Reservations to it's home sub-cluster.getSubCluster(GetSubClusterInfoRequest subClusterRequest) Get the membership information of subcluster as identified bySubClusterId.getSubClusters(GetSubClustersInfoRequest subClustersRequest) Get the membership information of all the subclusters that are currently participating in federation.The Router Supports GetTokenByRouterStoreToken.Query the Version information of Federation from the database.intThe Router Supports incrementCurrentKeyId.intIncrement DelegationToken SeqNum.voidinit(org.apache.hadoop.conf.Configuration conf) Initialize the FederationStore.Load the version information from the federation state store.registerSubCluster(SubClusterRegisterRequest registerSubClusterRequest) Register a subcluster by publishing capabilities as represented bySubClusterInfoto indicate participation in federation.SQLFederationStateStore Supports Remove MasterKey.removeStoredToken(RouterRMTokenRequest request) SQLFederationStateStore Supports Remove RMDelegationTokenIdentifier.voidsetDelegationTokenSeqNum(int seqNum) The Router Supports setDelegationTokenSeqNum.Set the policy configuration for a given queue.storeNewMasterKey(RouterMasterKeyRequest request) SQLFederationStateStore Supports Store New MasterKey.storeNewToken(RouterRMTokenRequest request) SQLFederationStateStore Supports Store RMDelegationTokenIdentifier.voidStore the Version information in federation state store.voidstoreVersion(byte[] fedVersion, String versionComment) Store the Federation Version in the database.subClusterHeartbeat(SubClusterHeartbeatRequest subClusterHeartbeatRequest) Periodic heartbeat from aResourceManagerparticipating in federation to indicate liveliness.Update the homeSubClusterIdof a previously submittedApplicationId.Update the homeSubClusterIdof a previously submittedReservationId.updateStoredToken(RouterRMTokenRequest request) SQLFederationStateStore Supports Update RMDelegationTokenIdentifier.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.yarn.server.federation.store.FederationStateStore
checkVersion
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG -
CALL_SP_ADD_RESERVATION_HOME_SUBCLUSTER
- See Also:
-
CALL_SP_GET_RESERVATION_HOME_SUBCLUSTER
- See Also:
-
CALL_SP_GET_RESERVATIONS_HOME_SUBCLUSTER
- See Also:
-
CALL_SP_DELETE_RESERVATION_HOME_SUBCLUSTER
- See Also:
-
CALL_SP_UPDATE_RESERVATION_HOME_SUBCLUSTER
- See Also:
-
CALL_SP_ADD_MASTERKEY
- See Also:
-
CALL_SP_GET_MASTERKEY
- See Also:
-
CALL_SP_DELETE_MASTERKEY
- See Also:
-
CALL_SP_ADD_DELEGATIONTOKEN
- See Also:
-
CALL_SP_GET_DELEGATIONTOKEN
- See Also:
-
CALL_SP_UPDATE_DELEGATIONTOKEN
- See Also:
-
CALL_SP_DELETE_DELEGATIONTOKEN
- See Also:
-
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:FederationStateStoreInitialize the FederationStore.- Specified by:
initin interfaceFederationStateStore- 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:FederationMembershipStateStoreRegister a subcluster by publishing capabilities as represented bySubClusterInfoto indicate participation in federation. This is typically done during initialization or restart/failover of the subcluster'sResourceManager. 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:
registerSubClusterin interfaceFederationMembershipStateStore- 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:FederationMembershipStateStoreDeregister a subcluster identified bySubClusterIdto change state in federation. This can be done to mark the sub cluster lost, deregistered, or decommissioned.- Specified by:
deregisterSubClusterin interfaceFederationMembershipStateStore- 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:FederationMembershipStateStorePeriodic heartbeat from aResourceManagerparticipating in federation to indicate liveliness. The heartbeat publishes the current capabilities as represented bySubClusterInfoof the subcluster. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.- Specified by:
subClusterHeartbeatin interfaceFederationMembershipStateStore- 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:FederationMembershipStateStoreGet the membership information of subcluster as identified bySubClusterId. The membership information includes the cluster endpoint and current capabilities as represented bySubClusterInfo.- Specified by:
getSubClusterin interfaceFederationMembershipStateStore- Parameters:
subClusterRequest- the subcluster whose information is required- Returns:
- the
SubClusterInfo, ornullif 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:FederationMembershipStateStoreGet 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 bySubClusterInfo.- Specified by:
getSubClustersin interfaceFederationMembershipStateStore- Parameters:
subClustersRequest- request for sub-clusters information- Returns:
- a map of
SubClusterInfokeyed by theSubClusterId - 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:FederationApplicationHomeSubClusterStoreRegister the homeSubClusterIdof the newly submittedApplicationId. 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, theSubClusterIdin this response will return the existing mapping which might be different from that in theAddApplicationHomeSubClusterRequest.- Specified by:
addApplicationHomeSubClusterin interfaceFederationApplicationHomeSubClusterStore- Parameters:
request- the request to register a new application with its home sub-cluster- Returns:
- upon successful registration of the application in the StateStore,
AddApplicationHomeSubClusterRequestcontaining 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:FederationApplicationHomeSubClusterStoreUpdate the homeSubClusterIdof a previously submittedApplicationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.- Specified by:
updateApplicationHomeSubClusterin interfaceFederationApplicationHomeSubClusterStore- 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:FederationApplicationHomeSubClusterStoreGet information about the application identified by the inputApplicationId.- Specified by:
getApplicationHomeSubClusterin interfaceFederationApplicationHomeSubClusterStore- Parameters:
request- contains the application queried- Returns:
ApplicationHomeSubClustercontaining 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:FederationApplicationHomeSubClusterStoreGet theApplicationHomeSubClusterlist representing the mapping of all submitted applications to it's home sub-cluster.- Specified by:
getApplicationsHomeSubClusterin interfaceFederationApplicationHomeSubClusterStore- 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:FederationApplicationHomeSubClusterStoreDelete the mapping of homeSubClusterIdof a previously submittedApplicationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.- Specified by:
deleteApplicationHomeSubClusterin interfaceFederationApplicationHomeSubClusterStore- 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:FederationPolicyStoreGet the policy configuration for a given queue.- Specified by:
getPolicyConfigurationin interfaceFederationPolicyStore- Parameters:
request- the queue whoseSubClusterPolicyConfigurationis required- Returns:
- the
SubClusterPolicyConfigurationfor the specified queue, ornullif 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:FederationPolicyStoreSet the policy configuration for a given queue.- Specified by:
setPolicyConfigurationin interfaceFederationPolicyStore- Parameters:
request- theSubClusterPolicyConfigurationwith the corresponding queue- Returns:
- response empty on successfully updating the
SubClusterPolicyConfigurationfor 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:FederationPolicyStoreGet a map of all queue-to-policy configurations.- Specified by:
getPoliciesConfigurationsin interfaceFederationPolicyStore- 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:FederationPolicyStoreDelete PoliciesConfigurations.- Specified by:
deletePoliciesConfigurationsin interfaceFederationPolicyStore- 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:FederationPolicyStoreDelete all queue-to-policy configurations.- Specified by:
deleteAllPoliciesConfigurationsin interfaceFederationPolicyStore- 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
Description copied from interface:FederationStateStoreGet theVersionof the underlying federation state store client.- Specified by:
getCurrentVersionin interfaceFederationStateStore- Returns:
- the
Versionof the underlying federation store client
-
loadVersion
Description copied from interface:FederationStateStoreLoad the version information from the federation state store.- Specified by:
loadVersionin interfaceFederationStateStore- Returns:
- the
Versionof the federation state store - Throws:
Exception- an exception occurred in load version.
-
getVersion
Query the Version information of Federation from the database.- Returns:
- Version Info.
- Throws:
Exception- Exception Information.
-
storeVersion
Description copied from interface:FederationStateStoreStore the Version information in federation state store.- Specified by:
storeVersionin interfaceFederationStateStore- Throws:
Exception- an exception occurred in store version.
-
deleteStateStore
Description copied from interface:FederationStateStoreWe will clear the data in stateStore through the deleteStateStore method.- Specified by:
deleteStateStorein interfaceFederationStateStore- 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
Description copied from interface:FederationStateStorePerform any cleanup operations of the StateStore.- Specified by:
closein interfaceFederationStateStore- Throws:
Exception- if cleanup fails
-
getConnection
Get a connection from the DataSource pool.- Returns:
- a connection from the DataSource pool.
- Throws:
SQLException- on failure
-
getConnection
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:FederationReservationHomeSubClusterStoreRegister the homeSubClusterIdof the newly submittedReservationId. 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, theSubClusterIdin this response will return the existing mapping which might be different from that in theAddReservationHomeSubClusterRequest.- Specified by:
addReservationHomeSubClusterin interfaceFederationReservationHomeSubClusterStore- Parameters:
request- the request to register a new Reservation with its home sub-cluster- Returns:
- upon successful registration of the Reservation in the StateStore,
AddReservationHomeSubClusterRequestcontaining 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:FederationReservationHomeSubClusterStoreGet information about the Reservation identified by the inputReservationId.- Specified by:
getReservationHomeSubClusterin interfaceFederationReservationHomeSubClusterStore- Parameters:
request- contains the Reservation queried- Returns:
ReservationHomeSubClustercontaining 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:FederationReservationHomeSubClusterStoreGet theReservationHomeSubClusterlist representing the mapping of all submitted Reservations to it's home sub-cluster.- Specified by:
getReservationsHomeSubClusterin interfaceFederationReservationHomeSubClusterStore- 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:FederationReservationHomeSubClusterStoreDelete the mapping of homeSubClusterIdof a previously submittedReservationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.- Specified by:
deleteReservationHomeSubClusterin interfaceFederationReservationHomeSubClusterStore- 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:FederationReservationHomeSubClusterStoreUpdate the homeSubClusterIdof a previously submittedReservationId. Currently response is empty if the operation was successful, if not an exception reporting reason for a failure.- Specified by:
updateReservationHomeSubClusterin interfaceFederationReservationHomeSubClusterStore- 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
-
storeNewMasterKey
public RouterMasterKeyResponse storeNewMasterKey(RouterMasterKeyRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException SQLFederationStateStore Supports Store New MasterKey.- Specified by:
storeNewMasterKeyin interfaceFederationDelegationTokenStateStore- 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:
removeStoredMasterKeyin interfaceFederationDelegationTokenStateStore- 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:
getMasterKeyByDelegationKeyin interfaceFederationDelegationTokenStateStore- 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:
storeNewTokenin interfaceFederationDelegationTokenStateStore- 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:
updateStoredTokenin interfaceFederationDelegationTokenStateStore- 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:
removeStoredTokenin interfaceFederationDelegationTokenStateStore- 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:
getTokenByRouterStoreTokenin interfaceFederationDelegationTokenStateStore- 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:
incrementDelegationTokenSeqNumin interfaceFederationDelegationTokenStateStore- Returns:
- delegationTokenSeqNum.
-
getDelegationTokenSeqNum
public int getDelegationTokenSeqNum()Get DelegationToken SeqNum.- Specified by:
getDelegationTokenSeqNumin interfaceFederationDelegationTokenStateStore- Returns:
- delegationTokenSeqNum.
-
setDelegationTokenSeqNum
public void setDelegationTokenSeqNum(int seqNum) Description copied from interface:FederationDelegationTokenStateStoreThe Router Supports setDelegationTokenSeqNum.- Specified by:
setDelegationTokenSeqNumin interfaceFederationDelegationTokenStateStore- Parameters:
seqNum- DelegationTokenSeqNum.
-
getCurrentKeyId
public int getCurrentKeyId()Get Current KeyId.- Specified by:
getCurrentKeyIdin interfaceFederationDelegationTokenStateStore- Returns:
- currentKeyId.
-
incrementCurrentKeyId
public int incrementCurrentKeyId()The Router Supports incrementCurrentKeyId.- Specified by:
incrementCurrentKeyIdin interfaceFederationDelegationTokenStateStore- Returns:
- CurrentKeyId.
-
getDataSource
@VisibleForTesting public com.zaxxer.hikari.HikariDataSource getDataSource()
-