@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class RMStateStore
extends org.apache.hadoop.service.AbstractService
| Modifier and Type | Class and Description |
|---|---|
static class |
RMStateStore.ApplicationAttemptState
State of an application attempt
|
static class |
RMStateStore.ApplicationState
State of an application application
|
static class |
RMStateStore.RMDTSecretManagerState |
static class |
RMStateStore.RMState
State of the ResourceManager
|
| Modifier and Type | Field and Description |
|---|---|
static org.apache.hadoop.io.Text |
AM_CLIENT_TOKEN_MASTER_KEY_NAME |
static org.apache.hadoop.io.Text |
AM_RM_TOKEN_SERVICE |
protected static String |
DELEGATION_KEY_PREFIX |
protected static String |
DELEGATION_TOKEN_PREFIX |
protected static String |
DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX |
static org.apache.commons.logging.Log |
LOG |
protected static String |
RM_APP_ROOT |
protected static String |
RM_DT_SECRET_MANAGER_ROOT |
protected static String |
VERSION_NODE |
| Constructor and Description |
|---|
RMStateStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkVersion()
1) Versioning scheme: major.minor.
|
protected abstract void |
closeInternal()
Derived classes close themselves using this method.
|
org.apache.hadoop.security.Credentials |
getCredentialsFromAppAttempt(RMAppAttempt appAttempt) |
protected abstract RMStateVersion |
getCurrentVersion()
Get the current version of the underlying state store.
|
protected void |
handleStoreEvent(RMStateStoreEvent event) |
protected abstract void |
initInternal(org.apache.hadoop.conf.Configuration conf)
Derived classes initialize themselves using this method.
|
abstract 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 abstract RMStateVersion |
loadVersion()
Derived class use this method to load the version information from state
store.
|
protected void |
notifyStoreOperationFailed(Exception failureCause) |
void |
removeApplication(RMApp app)
Non-blocking API
ResourceManager services call this to remove an application from the state
store
This does not block the dispatcher threads
There is no notification of completion for this operation.
|
protected abstract void |
removeApplicationStateInternal(RMStateStore.ApplicationState appState)
Blocking API
Derived classes must implement this method to remove the state of an
application and its attempts
|
void |
removeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
int sequenceNumber)
RMDTSecretManager call this to remove the state of a delegation token
|
protected abstract 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 |
removeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
RMDTSecretManager call this to remove the state of a master key
|
protected abstract 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 |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
protected void |
serviceStart() |
protected void |
serviceStop() |
void |
setRMDispatcher(org.apache.hadoop.yarn.event.Dispatcher dispatcher)
Dispatcher used to send state operation completion events to
ResourceManager services
|
protected abstract void |
startInternal()
Derived classes start themselves using this method.
|
protected abstract void |
storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId,
ApplicationAttemptStateDataPBImpl attemptStateData)
Blocking API
Derived classes must implement this method to store the state of an
application attempt
|
protected abstract void |
storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateData)
Blocking API
Derived classes must implement this method to store the state of an
application.
|
void |
storeNewApplication(RMApp app)
Non-Blocking API
ResourceManager services use this to store the application's state
This does not block the dispatcher threads
RMAppStoredEvent will be sent on completion to notify the RMApp
|
void |
storeNewApplicationAttempt(RMAppAttempt appAttempt) |
void |
storeRMDelegationTokenAndSequenceNumber(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
RMDTSecretManager call this to store the state of a delegation token
and sequence number
|
protected abstract 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 |
storeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
RMDTSecretManager call this to store the state of a master key
|
protected abstract 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 abstract void |
storeVersion()
Derived class use this method to store the version information.
|
void |
updateApplicationAttemptState(RMStateStore.ApplicationAttemptState attemptState) |
protected abstract void |
updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId,
ApplicationAttemptStateDataPBImpl attemptStateData) |
void |
updateApplicationState(RMStateStore.ApplicationState appState) |
protected abstract void |
updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateData) |
void |
updateRMDelegationTokenAndSequenceNumber(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
RMDTSecretManager call this to update the state of a delegation token
and sequence number
|
protected abstract 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
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected static final String RM_APP_ROOT
protected static final String RM_DT_SECRET_MANAGER_ROOT
protected static final String DELEGATION_KEY_PREFIX
protected static final String DELEGATION_TOKEN_PREFIX
protected static final String DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX
protected static final String VERSION_NODE
public static final org.apache.commons.logging.Log LOG
public static final org.apache.hadoop.io.Text AM_RM_TOKEN_SERVICE
public static final org.apache.hadoop.io.Text AM_CLIENT_TOKEN_MASTER_KEY_NAME
public void setRMDispatcher(org.apache.hadoop.yarn.event.Dispatcher dispatcher)
protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.AbstractServiceExceptionprotected void serviceStart()
throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionprotected abstract void initInternal(org.apache.hadoop.conf.Configuration conf)
throws Exception
Exceptionprotected abstract void startInternal()
throws Exception
Exceptionprotected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionprotected abstract void closeInternal()
throws Exception
Exceptionpublic void checkVersion()
throws Exception
Exceptionprotected abstract RMStateVersion loadVersion() throws Exception
Exceptionprotected abstract void storeVersion()
throws Exception
Exceptionprotected abstract RMStateVersion getCurrentVersion()
public abstract RMStateStore.RMState loadState() throws Exception
Exceptionpublic void storeNewApplication(RMApp app)
public void updateApplicationState(RMStateStore.ApplicationState appState)
protected abstract void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateData)
throws Exception
Exceptionprotected abstract void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateData)
throws Exception
Exceptionpublic void storeNewApplicationAttempt(RMAppAttempt appAttempt)
public void updateApplicationAttemptState(RMStateStore.ApplicationAttemptState attemptState)
protected abstract void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId,
ApplicationAttemptStateDataPBImpl attemptStateData)
throws Exception
Exceptionprotected abstract void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId,
ApplicationAttemptStateDataPBImpl attemptStateData)
throws Exception
Exceptionpublic void storeRMDelegationTokenAndSequenceNumber(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
protected abstract void storeRMDelegationTokenAndSequenceNumberState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
throws Exception
Exceptionpublic void removeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
int sequenceNumber)
protected abstract void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
throws Exception
Exceptionpublic void updateRMDelegationTokenAndSequenceNumber(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
protected abstract void updateRMDelegationTokenAndSequenceNumberInternal(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
throws Exception
Exceptionpublic void storeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
protected abstract void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
throws Exception
Exceptionpublic void removeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
protected abstract void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
throws Exception
Exceptionpublic void removeApplication(RMApp app)
protected abstract void removeApplicationStateInternal(RMStateStore.ApplicationState appState) throws Exception
Exceptionpublic org.apache.hadoop.security.Credentials getCredentialsFromAppAttempt(RMAppAttempt appAttempt)
protected void handleStoreEvent(RMStateStoreEvent event)
protected void notifyStoreOperationFailed(Exception failureCause)
Copyright © 2014 Apache Software Foundation. All Rights Reserved.