Class NullRMStateStore
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
org.apache.hadoop.yarn.server.resourcemanager.recovery.NullRMStateStore
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
RMStateStore.ProxyCAState, RMStateStore.RMDTSecretManagerState, RMStateStore.RMState, RMStateStore.RMStateStoreStateNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
AM_CLIENT_TOKEN_MASTER_KEY_NAME, AM_RM_TOKEN_SERVICE, AMRMTOKEN_SECRET_MANAGER_ROOT, baseEpoch, DELEGATION_KEY_PREFIX, DELEGATION_TOKEN_PREFIX, DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX, EPOCH_NODE, LOG, PROXY_CA_CERT_NODE, PROXY_CA_PRIVATE_KEY_NODE, PROXY_CA_ROOT, RESERVATION_SYSTEM_ROOT, resourceManager, RM_APP_ROOT, RM_DELEGATION_TOKENS_ROOT_ZNODE_NAME, RM_DT_SECRET_MANAGER_ROOT, rmStateStoreEventHandler, VERSION_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid1) Versioning scheme: major.minor.protected voidDerived classes close themselves using this method.voidDerived classes must implement this method to delete the state store.longGet the current epoch of RM and increment the value.protected org.apache.hadoop.yarn.server.records.VersionGet the current version of the underlying state store.protected voidinitInternal(org.apache.hadoop.conf.Configuration conf) Derived classes initialize themselves using this method.Blocking API The derived class must recover state from the store and return a new RMState object populated with that state This must not be called on the dispatcher thread.protected org.apache.hadoop.yarn.server.records.VersionDerived class use this method to load the version information from state store.voidremoveApplication(org.apache.hadoop.yarn.api.records.ApplicationId removeAppId) Derived classes must implement this method to remove application from the state store.voidremoveApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) Blocking API Derived classes must implement this method to remove the state of specified attempt.protected voidBlocking API Derived classes must implement this method to remove the state of an application and its attempts.protected voidremoveReservationState(String planName, String reservationIdName) Blocking API Derived classes must implement this method to remove the state of a reservation allocation.voidremoveRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier) Blocking API Derived classes must implement this method to remove the state of RMDelegationToken.voidremoveRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) Blocking API Derived classes must implement this method to remove the state of DelegationToken Master Key.protected voidDerived classes start themselves using this method.protected voidstoreApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) Blocking API Derived classes must implement this method to store the state of an application attempt.protected voidstoreApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) Blocking API Derived classes must implement this method to store the state of an application.voidstoreOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState state, boolean isUpdate) Blocking API Derived classes must implement this method to store or update the state of AMRMToken Master Key.protected voidstoreProxyCACertState(X509Certificate caCert, PrivateKey caPrivateKey) Blocking API Derived classes must implement this method to store the CA Certificate and Private Key.protected voidstoreReservationState(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation, String planName, String reservationIdName) Blocking API Derived classes must implement this method to store the state of a reservation allocation.voidstoreRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) Blocking API Derived classes must implement this method to store the state of RMDelegationToken and sequence number.voidstoreRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) Blocking API Derived classes must implement this method to store the state of DelegationToken Master Key.protected voidDerived class use this method to store the version information.protected voidupdateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) protected voidupdateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) protected voidupdateRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) Blocking API Derived classes must implement this method to update the state of RMDelegationToken and sequence number.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
getCredentialsFromAppAttempt, getRMStateStoreEventHandler, getRMStateStoreState, handleStoreEvent, isFencedState, nextEpoch, notifyStoreOperationFailed, removeApplication, removeApplicationAttempt, removeReservation, removeRMDelegationToken, removeRMDTMasterKey, serviceInit, serviceStart, serviceStop, setResourceManager, setRMDispatcher, storeNewApplication, storeNewApplicationAttempt, storeNewReservation, storeOrUpdateAMRMTokenSecretManager, storeProxyCACert, storeRMDelegationToken, storeRMDTMasterKey, updateApplicationAttemptState, updateApplicationState, updateApplicationState, updateApplicationStateSynchronously, updateFencedState, updateRMDelegationTokenMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
NullRMStateStore
public NullRMStateStore()
-
-
Method Details
-
initInternal
Description copied from class:RMStateStoreDerived classes initialize themselves using this method.- Specified by:
initInternalin classRMStateStore- Parameters:
conf- Configuration.- Throws:
Exception- error occur.
-
startInternal
Description copied from class:RMStateStoreDerived classes start themselves using this method. The base class is started and the event dispatcher is ready to use at this point.- Specified by:
startInternalin classRMStateStore- Throws:
Exception- error occur.
-
closeInternal
Description copied from class:RMStateStoreDerived classes close themselves using this method. The base class will be closed and the event dispatcher will be shutdown after this.- Specified by:
closeInternalin classRMStateStore- Throws:
Exception- error occur.
-
getAndIncrementEpoch
Description copied from class:RMStateStoreGet the current epoch of RM and increment the value.- Specified by:
getAndIncrementEpochin classRMStateStore- Returns:
- current epoch.
- Throws:
Exception- error occur.
-
loadState
Description copied from class:RMStateStoreBlocking API The derived class must recover state from the store and return a new RMState object populated with that state This must not be called on the dispatcher thread.- Specified by:
loadStatein classRMStateStore- Returns:
- RMState.
- Throws:
Exception- error occur.
-
storeApplicationStateInternal
protected void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store the state of an application.- Specified by:
storeApplicationStateInternalin classRMStateStore- Parameters:
appId- application Id.appStateData- application StateData.- Throws:
Exception- error occur.
-
storeApplicationAttemptStateInternal
protected void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store the state of an application attempt.- Specified by:
storeApplicationAttemptStateInternalin classRMStateStore- Parameters:
attemptId- Application AttemptId.attemptStateData- Application AttemptStateData.- Throws:
Exception- error occur.
-
removeApplicationStateInternal
Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to remove the state of an application and its attempts.- Specified by:
removeApplicationStateInternalin classRMStateStore- Parameters:
appState- ApplicationStateData.- Throws:
Exception- error occurs.
-
storeRMDelegationTokenState
public void storeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store the state of RMDelegationToken and sequence number.- Specified by:
storeRMDelegationTokenStatein classRMStateStore- Parameters:
rmDTIdentifier- RMDelegationTokenIdentifier.renewDate- token renew date.- Throws:
Exception- error occur.
-
removeRMDelegationTokenState
public void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to remove the state of RMDelegationToken.- Specified by:
removeRMDelegationTokenStatein classRMStateStore- Parameters:
rmDTIdentifier- RMDelegationTokenIdentifier.- Throws:
Exception- error occurs.
-
updateRMDelegationTokenState
protected void updateRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to update the state of RMDelegationToken and sequence number.- Specified by:
updateRMDelegationTokenStatein classRMStateStore- Parameters:
rmDTIdentifier- RMDelegationTokenIdentifier.renewDate- token renew date.- Throws:
Exception- error occurs.
-
storeRMDTMasterKeyState
public void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store the state of DelegationToken Master Key.- Specified by:
storeRMDTMasterKeyStatein classRMStateStore- Parameters:
delegationKey- DelegationToken Master Key.- Throws:
Exception- error occur.
-
storeReservationState
protected void storeReservationState(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation, String planName, String reservationIdName) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store the state of a reservation allocation.- Specified by:
storeReservationStatein classRMStateStore- Parameters:
reservationAllocation- reservation Allocation.planName- plan Name.reservationIdName- reservationId Name.- Throws:
Exception- error occurs.
-
removeReservationState
Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to remove the state of a reservation allocation.- Specified by:
removeReservationStatein classRMStateStore- Parameters:
planName- plan Name.reservationIdName- reservationId Name.- Throws:
Exception- exception occurs.
-
removeRMDTMasterKeyState
public void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to remove the state of DelegationToken Master Key.- Specified by:
removeRMDTMasterKeyStatein classRMStateStore- Parameters:
delegationKey- DelegationKey.- Throws:
Exception- exception occurs.
-
updateApplicationStateInternal
protected void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) throws Exception - Specified by:
updateApplicationStateInternalin classRMStateStore- Throws:
Exception
-
updateApplicationAttemptStateInternal
protected void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) throws Exception - Specified by:
updateApplicationAttemptStateInternalin classRMStateStore- Throws:
Exception
-
removeApplicationAttemptInternal
public void removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to remove the state of specified attempt.- Specified by:
removeApplicationAttemptInternalin classRMStateStore- Parameters:
attemptId- application attempt id.- Throws:
Exception- exception occurs.
-
checkVersion
Description copied from class:RMStateStore1) Versioning scheme: major.minor. For e.g. 1.0, 1.1, 1.2...1.25, 2.0 etc. 2) Any incompatible change of state-store is a major upgrade, and any compatible change of state-store is a minor upgrade. 3) If theres's no version, treat it as CURRENT_VERSION_INFO. 4) Within a minor upgrade, say 1.1 to 1.2: overwrite the version info and proceed as normal. 5) Within a major upgrade, say 1.2 to 2.0: throw exception and indicate user to use a separate upgrade tool to upgrade RM state.- Overrides:
checkVersionin classRMStateStore- Throws:
Exception- error occur.
-
loadVersion
Description copied from class:RMStateStoreDerived class use this method to load the version information from state store.- Specified by:
loadVersionin classRMStateStore- Returns:
- current version.
- Throws:
Exception- error occur.
-
storeVersion
Description copied from class:RMStateStoreDerived class use this method to store the version information.- Specified by:
storeVersionin classRMStateStore- Throws:
Exception- error occur.
-
getCurrentVersion
protected org.apache.hadoop.yarn.server.records.Version getCurrentVersion()Description copied from class:RMStateStoreGet the current version of the underlying state store.- Specified by:
getCurrentVersionin classRMStateStore- Returns:
- current version.
-
storeOrUpdateAMRMTokenSecretManagerState
public void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState state, boolean isUpdate) Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store or update the state of AMRMToken Master Key.- Specified by:
storeOrUpdateAMRMTokenSecretManagerStatein classRMStateStore- Parameters:
state- amrmTokenSecretManagerState.isUpdate- true, update; otherwise not update.
-
deleteStore
Description copied from class:RMStateStoreDerived classes must implement this method to delete the state store.- Specified by:
deleteStorein classRMStateStore- Throws:
Exception- exception occurs.
-
removeApplication
public void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId removeAppId) throws Exception Description copied from class:RMStateStoreDerived classes must implement this method to remove application from the state store.- Specified by:
removeApplicationin classRMStateStore- Parameters:
removeAppId- application Id.- Throws:
Exception- exception occurs.
-
storeProxyCACertState
protected void storeProxyCACertState(X509Certificate caCert, PrivateKey caPrivateKey) throws Exception Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to store the CA Certificate and Private Key.- Specified by:
storeProxyCACertStatein classRMStateStore- Parameters:
caCert- X509Certificate.caPrivateKey- PrivateKey.- Throws:
Exception- error occurs.
-