Class ZookeeperFederationStateStore
java.lang.Object
org.apache.hadoop.yarn.server.federation.store.impl.ZookeeperFederationStateStore
- All Implemented Interfaces:
FederationApplicationHomeSubClusterStore,FederationDelegationTokenStateStore,FederationMembershipStateStore,FederationPolicyStore,FederationReservationHomeSubClusterStore,FederationStateStore
ZooKeeper implementation of
FederationStateStore.
The znode structure is as follows:
ROOT_DIR_PATH
|--- MEMBERSHIP
| |----- SC1
| |----- SC2
|--- APPLICATION
| |----- HIERARCHIES
| | |----- 1
| | | |----- (#ApplicationId barring last character)
| | | | | |----- APP Data
| | | ....
| | |
| | |----- 2
| | | |----- (#ApplicationId barring last 2 characters)
| | | | |----- (#Last 2 characters of ApplicationId)
| | | | | |----- APP Data
|--- POLICY
| |----- QUEUE1
| |----- QUEUE1
|--- RESERVATION
| |----- RESERVATION1
| |----- RESERVATION2
|--- ROUTER_RM_DT_SECRET_MANAGER_ROOT
| |----- ROUTER_RM_DELEGATION_TOKENS_ROOT
| | |----- RM_DELEGATION_TOKEN_1
| | |----- RM_DELEGATION_TOKEN_2
| | |----- RM_DELEGATION_TOKEN_3
| |----- ROUTER_RM_DT_MASTER_KEYS_ROOT
| | |----- DELEGATION_KEY_1
| |----- ROUTER_RM_DT_SEQUENTIAL_NUMBER-
Field Summary
Fields -
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.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.intGet Current KeyId.Get theVersionof the underlying federation state store client.intGet DelegationToken SeqNum.ZookeeperFederationStateStore 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 request) Get the membership information of subcluster as identified bySubClusterId.getSubClusters(GetSubClustersInfoRequest request) Get the membership information of all the subclusters that are currently participating in federation.The Router Supports GetTokenByRouterStoreToken.intThe Router Supports incrementCurrentKeyId.intIncrease SequenceNum.voidinit(org.apache.hadoop.conf.Configuration conf) Initialize the FederationStore.Load the version information from the federation state store.Register a subcluster by publishing capabilities as represented bySubClusterInfoto indicate participation in federation.ZookeeperFederationStateStore Supports Remove MasterKey.removeStoredToken(RouterRMTokenRequest request) ZookeeperFederationStateStore Supports Remove RMDelegationTokenIdentifier.voidvoidsetDelegationTokenSeqNum(int seqNum) Set DelegationToken SeqNum.Set the policy configuration for a given queue.protected voidstoreApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, byte[] data) storeNewMasterKey(RouterMasterKeyRequest request) ZookeeperFederationStateStore Supports Store NewMasterKey.storeNewToken(RouterRMTokenRequest request) ZookeeperFederationStateStore Supports Store RMDelegationTokenIdentifier.voidStore the Version information in federation state store.Periodic heartbeat from aResourceManagerparticipating in federation to indicate liveliness.Update the homeSubClusterIdof a previously submittedApplicationId.protected voidupdateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, byte[] data) Update the homeSubClusterIdof a previously submittedReservationId.updateStoredToken(RouterRMTokenRequest request) ZookeeperFederationStateStore 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
-
ROOT_ZNODE_NAME_VERSION
- See Also:
-
ROUTER_APP_ROOT_HIERARCHIES
- See Also:
-
CURRENT_VERSION_INFO
-
-
Constructor Details
-
ZookeeperFederationStateStore
public ZookeeperFederationStateStore()
-
-
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
-
close
Description copied from interface:FederationStateStorePerform any cleanup operations of the StateStore.- Specified by:
closein interfaceFederationStateStore- Throws:
Exception- if cleanup fails
-
addApplicationHomeSubCluster
public AddApplicationHomeSubClusterResponse addApplicationHomeSubCluster(AddApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException Register 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- indicates exceptions from yarn servers.
-
updateApplicationHomeSubCluster
public UpdateApplicationHomeSubClusterResponse updateApplicationHomeSubCluster(UpdateApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException Update 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- indicates exceptions from yarn servers.
-
getApplicationHomeSubCluster
public GetApplicationHomeSubClusterResponse getApplicationHomeSubCluster(GetApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException Get 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- indicates exceptions from yarn servers.
-
getApplicationsHomeSubCluster
public GetApplicationsHomeSubClusterResponse getApplicationsHomeSubCluster(GetApplicationsHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException Get 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- indicates exceptions from yarn servers.
-
deleteApplicationHomeSubCluster
public DeleteApplicationHomeSubClusterResponse deleteApplicationHomeSubCluster(DeleteApplicationHomeSubClusterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException Delete 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
-
registerSubCluster
public SubClusterRegisterResponse registerSubCluster(SubClusterRegisterRequest request) 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:
request- 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 request) 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:
request- - 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 request) 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:
request- 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 request) 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:
request- 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 request) 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:
request- 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
-
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.
-
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.
-
storeApplicationStateInternal
protected void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, byte[] data) throws Exception - Throws:
Exception
-
updateApplicationStateInternal
protected void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, byte[] data) throws Exception - Throws:
Exception
-
getOpDurations
-
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
-
storeNewMasterKey
public RouterMasterKeyResponse storeNewMasterKey(RouterMasterKeyRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException ZookeeperFederationStateStore Supports Store NewMasterKey.- 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 ZookeeperFederationStateStore Supports Remove MasterKey.- 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 ZookeeperFederationStateStore Supports Remove MasterKey.- 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 ZookeeperFederationStateStore Supports Store RMDelegationTokenIdentifier. The stored token method is a synchronized method used to ensure that storeNewToken is a thread-safe method.- 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 ZookeeperFederationStateStore Supports Update RMDelegationTokenIdentifier. The update stored token method is a synchronized method used to ensure that storeNewToken is a thread-safe method.- 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 ZookeeperFederationStateStore Supports Remove RMDelegationTokenIdentifier. The remove stored token method is a synchronized method used to ensure that storeNewToken is a thread-safe method.- 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 unsuccessfulIOException- An IO Error occurred
-
incrementDelegationTokenSeqNum
public int incrementDelegationTokenSeqNum()Increase SequenceNum. For zk, this is a distributed value. To ensure data consistency, we will use the synchronized keyword. For ZookeeperFederationStateStore, in order to reduce the interaction with ZK, we will apply for SequenceNum from ZK in batches(Apply when currentSeqNum >= currentMaxSeqNum), and assign this value to the variable currentMaxSeqNum. When calling the method incrementDelegationTokenSeqNum, if currentSeqNum < currentMaxSeqNum, we return ++currentMaxSeqNum, When currentSeqNum >= currentMaxSeqNum, we re-apply SequenceNum from zk.- Specified by:
incrementDelegationTokenSeqNumin interfaceFederationDelegationTokenStateStore- Returns:
- SequenceNum.
-
getDelegationTokenSeqNum
public int getDelegationTokenSeqNum()Get DelegationToken SeqNum.- Specified by:
getDelegationTokenSeqNumin interfaceFederationDelegationTokenStateStore- Returns:
- delegationTokenSeqNum.
-
setDelegationTokenSeqNum
public void setDelegationTokenSeqNum(int seqNum) Set DelegationToken SeqNum.- Specified by:
setDelegationTokenSeqNumin interfaceFederationDelegationTokenStateStore- Parameters:
seqNum- sequenceNum.
-
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.
-
resetOpDurations
@VisibleForTesting public void resetOpDurations()
-