Class LeveldbRMStateStore
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
org.apache.hadoop.yarn.server.resourcemanager.recovery.LeveldbRMStateStore
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
Changes from 1.0 to 1.1, Addition of ReservationSystem state.
-
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
FieldsFields 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, 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 TypeMethodDescriptionprotected 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.protected voidremoveRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier tokenId) Blocking API Derived classes must implement this method to remove the state of RMDelegationToken.protected voidremoveRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey masterKey) Blocking API Derived classes must implement this method to remove the state of DelegationToken Master Key.protected voidsetDbManager(DBManager dbManager) 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.protected voidstoreRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier tokenId, Long renewDate) Blocking API Derived classes must implement this method to store the state of RMDelegationToken and sequence number.protected voidstoreRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey masterKey) 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 voidstoreVersion(org.apache.hadoop.yarn.server.records.Version version) 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 tokenId, 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
checkVersion, 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
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
LeveldbRMStateStore
public LeveldbRMStateStore()
-
-
Method Details
-
initInternal
protected void initInternal(org.apache.hadoop.conf.Configuration conf) Description copied from class:RMStateStoreDerived classes initialize themselves using this method.- Specified by:
initInternalin classRMStateStore- Parameters:
conf- Configuration.
-
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.
-
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.
-
storeVersion
protected void storeVersion(org.apache.hadoop.yarn.server.records.Version version) -
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.
-
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 IOException 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:
IOException
-
updateApplicationStateInternal
protected void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) throws IOException - Specified by:
updateApplicationStateInternalin classRMStateStore- Throws:
IOException
-
storeApplicationAttemptStateInternal
protected void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) throws IOException 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:
IOException
-
updateApplicationAttemptStateInternal
protected void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) throws IOException - Specified by:
updateApplicationAttemptStateInternalin classRMStateStore- Throws:
IOException
-
removeApplicationAttemptInternal
public void removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) throws IOException 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:
IOException
-
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:
IOException
-
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.
-
storeRMDelegationTokenState
protected void storeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier tokenId, Long renewDate) throws IOException 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:
tokenId- RMDelegationTokenIdentifier.renewDate- token renew date.- Throws:
IOException
-
updateRMDelegationTokenState
protected void updateRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier tokenId, Long renewDate) throws IOException 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:
tokenId- RMDelegationTokenIdentifier.renewDate- token renew date.- Throws:
IOException
-
removeRMDelegationTokenState
protected void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier tokenId) throws IOException Description copied from class:RMStateStoreBlocking API Derived classes must implement this method to remove the state of RMDelegationToken.- Specified by:
removeRMDelegationTokenStatein classRMStateStore- Parameters:
tokenId- RMDelegationTokenIdentifier.- Throws:
IOException
-
storeRMDTMasterKeyState
protected void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey masterKey) throws IOException 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:
masterKey- DelegationToken Master Key.- Throws:
IOException
-
removeRMDTMasterKeyState
protected void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey masterKey) throws IOException 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:
masterKey- DelegationKey.- Throws:
IOException
-
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.
-
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.
-
deleteStore
Description copied from class:RMStateStoreDerived classes must implement this method to delete the state store.- Specified by:
deleteStorein classRMStateStore- Throws:
IOException
-
removeApplication
public void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId removeAppId) throws IOException 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:
IOException
-
setDbManager
-