org.apache.hadoop.yarn.server.resourcemanager.recovery
Class MemoryRMStateStore

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
          extended by org.apache.hadoop.yarn.server.resourcemanager.recovery.MemoryRMStateStore
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class MemoryRMStateStore
extends RMStateStore


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore
RMStateStore.ApplicationAttemptState, RMStateStore.ApplicationState, RMStateStore.RMDTSecretManagerState, RMStateStore.RMState
 
Nested 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, DELEGATION_KEY_PREFIX, DELEGATION_TOKEN_PREFIX, DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX, EPOCH_NODE, LOG, RM_APP_ROOT, RM_DT_SECRET_MANAGER_ROOT, VERSION_NODE
 
Constructor Summary
MemoryRMStateStore()
           
 
Method Summary
 void checkVersion()
          1) Versioning scheme: major.minor.
protected  void closeInternal()
          Derived classes close themselves using this method.
 void deleteStore()
          Derived classes must implement this method to delete the state store
 long getAndIncrementEpoch()
          Get the current epoch of RM and increment the value.
protected  org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
          Get the current version of the underlying state store.
 RMStateStore.RMState getState()
           
 void initInternal(org.apache.hadoop.conf.Configuration conf)
          Derived classes initialize themselves using this method.
 RMStateStore.RMState loadState()
          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.Version loadVersion()
          Derived class use this method to load the version information from state store.
 void removeApplicationStateInternal(RMStateStore.ApplicationState appState)
          Blocking API Derived classes must implement this method to remove the state of an application and its attempts
 void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
          Blocking API Derived classes must implement this method to remove the state of RMDelegationToken
 void removeRMDTMasterKeyState(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  void startInternal()
          Derived classes start themselves using this method.
 void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, ApplicationAttemptStateData attemptStateData)
          Blocking API Derived classes must implement this method to store the state of an application attempt
 void storeApplicationStateInternal(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.
 void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate)
          Blocking API Derived classes must implement this method to store or update the state of AMRMToken Master Key
 void storeRMDelegationTokenAndSequenceNumberState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate, int latestSequenceNumber)
          Blocking API Derived classes must implement this method to store the state of RMDelegationToken and sequence number
 void storeRMDTMasterKeyState(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  void storeVersion()
          Derived class use this method to store the version information.
 void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, ApplicationAttemptStateData attemptStateData)
           
 void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData)
           
protected  void updateRMDelegationTokenAndSequenceNumberInternal(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate, int latestSequenceNumber)
          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, handleStoreEvent, notifyStoreOperationFailed, removeApplication, removeRMDelegationToken, removeRMDTMasterKey, serviceInit, serviceStart, serviceStop, setResourceManager, setRMDispatcher, storeNewApplication, storeNewApplicationAttempt, storeRMDelegationTokenAndSequenceNumber, storeRMDTMasterKey, updateApplicationAttemptState, updateApplicationState, updateRMDelegationTokenAndSequenceNumber
 
Methods 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemoryRMStateStore

public MemoryRMStateStore()
Method Detail

getState

public RMStateStore.RMState getState()

checkVersion

public void checkVersion()
                  throws Exception
Description copied from class: RMStateStore
1) 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 1.0. 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:
checkVersion in class RMStateStore
Throws:
Exception

getAndIncrementEpoch

public long getAndIncrementEpoch()
                          throws Exception
Description copied from class: RMStateStore
Get the current epoch of RM and increment the value.

Specified by:
getAndIncrementEpoch in class RMStateStore
Throws:
Exception

loadState

public RMStateStore.RMState loadState()
                               throws Exception
Description copied from class: RMStateStore
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

Specified by:
loadState in class RMStateStore
Throws:
Exception

initInternal

public void initInternal(org.apache.hadoop.conf.Configuration conf)
Description copied from class: RMStateStore
Derived classes initialize themselves using this method.

Specified by:
initInternal in class RMStateStore

startInternal

protected void startInternal()
                      throws Exception
Description copied from class: RMStateStore
Derived classes start themselves using this method. The base class is started and the event dispatcher is ready to use at this point

Specified by:
startInternal in class RMStateStore
Throws:
Exception

closeInternal

protected void closeInternal()
                      throws Exception
Description copied from class: RMStateStore
Derived classes close themselves using this method. The base class will be closed and the event dispatcher will be shutdown after this

Specified by:
closeInternal in class RMStateStore
Throws:
Exception

storeApplicationStateInternal

public void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
                                          ApplicationStateData appStateData)
                                   throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to store the state of an application.

Specified by:
storeApplicationStateInternal in class RMStateStore
Throws:
Exception

updateApplicationStateInternal

public void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
                                           ApplicationStateData appStateData)
                                    throws Exception
Specified by:
updateApplicationStateInternal in class RMStateStore
Throws:
Exception

storeApplicationAttemptStateInternal

public void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
                                                 ApplicationAttemptStateData attemptStateData)
                                          throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to store the state of an application attempt

Specified by:
storeApplicationAttemptStateInternal in class RMStateStore
Throws:
Exception

updateApplicationAttemptStateInternal

public void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
                                                  ApplicationAttemptStateData attemptStateData)
                                           throws Exception
Specified by:
updateApplicationAttemptStateInternal in class RMStateStore
Throws:
Exception

removeApplicationStateInternal

public void removeApplicationStateInternal(RMStateStore.ApplicationState appState)
                                    throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to remove the state of an application and its attempts

Specified by:
removeApplicationStateInternal in class RMStateStore
Throws:
Exception

storeRMDelegationTokenAndSequenceNumberState

public void storeRMDelegationTokenAndSequenceNumberState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
                                                         Long renewDate,
                                                         int latestSequenceNumber)
                                                  throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to store the state of RMDelegationToken and sequence number

Specified by:
storeRMDelegationTokenAndSequenceNumberState in class RMStateStore
Throws:
Exception

removeRMDelegationTokenState

public void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
                                  throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to remove the state of RMDelegationToken

Specified by:
removeRMDelegationTokenState in class RMStateStore
Throws:
Exception

updateRMDelegationTokenAndSequenceNumberInternal

protected void updateRMDelegationTokenAndSequenceNumberInternal(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
                                                                Long renewDate,
                                                                int latestSequenceNumber)
                                                         throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to update the state of RMDelegationToken and sequence number

Specified by:
updateRMDelegationTokenAndSequenceNumberInternal in class RMStateStore
Throws:
Exception

storeRMDTMasterKeyState

public void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
                             throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to store the state of DelegationToken Master Key

Specified by:
storeRMDTMasterKeyState in class RMStateStore
Throws:
Exception

removeRMDTMasterKeyState

public void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
                              throws Exception
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to remove the state of DelegationToken Master Key

Specified by:
removeRMDTMasterKeyState in class RMStateStore
Throws:
Exception

loadVersion

protected org.apache.hadoop.yarn.server.records.Version loadVersion()
                                                             throws Exception
Description copied from class: RMStateStore
Derived class use this method to load the version information from state store.

Specified by:
loadVersion in class RMStateStore
Throws:
Exception

storeVersion

protected void storeVersion()
                     throws Exception
Description copied from class: RMStateStore
Derived class use this method to store the version information.

Specified by:
storeVersion in class RMStateStore
Throws:
Exception

getCurrentVersion

protected org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
Description copied from class: RMStateStore
Get the current version of the underlying state store.

Specified by:
getCurrentVersion in class RMStateStore

storeOrUpdateAMRMTokenSecretManagerState

public void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState,
                                                     boolean isUpdate)
Description copied from class: RMStateStore
Blocking API Derived classes must implement this method to store or update the state of AMRMToken Master Key

Specified by:
storeOrUpdateAMRMTokenSecretManagerState in class RMStateStore

deleteStore

public void deleteStore()
                 throws Exception
Description copied from class: RMStateStore
Derived classes must implement this method to delete the state store

Specified by:
deleteStore in class RMStateStore
Throws:
Exception


Copyright © 2014 Apache Software Foundation. All Rights Reserved.