@InterfaceAudience.Private @InterfaceStability.Unstable public abstract class RMStateStore extends 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
|
Service.STATE
Modifier and Type | Field and Description |
---|---|
static Text |
AM_CLIENT_TOKEN_MASTER_KEY_NAME |
static Text |
AM_RM_TOKEN_SERVICE |
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
RMStateStore() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeInternal()
Derived classes close themselves using this method.
|
protected abstract void |
initInternal(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
|
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.
|
void |
removeApplication(RMStateStore.ApplicationState appState) |
protected abstract void |
removeApplicationState(RMStateStore.ApplicationState appState)
Blocking API
Derived classes must implement this method to remove the state of an
application and its attempts
|
void |
removeRMDelegationToken(RMDelegationTokenIdentifier rmDTIdentifier,
int sequenceNumber)
RMDTSecretManager call this to remove the state of a delegation token
|
protected abstract void |
removeRMDelegationTokenState(RMDelegationTokenIdentifier rmDTIdentifier)
Blocking API
Derived classes must implement this method to remove the state of RMDelegationToken
|
void |
removeRMDTMasterKey(DelegationKey delegationKey)
RMDTSecretManager call this to remove the state of a master key
|
protected abstract void |
removeRMDTMasterKeyState(DelegationKey delegationKey)
Blocking API
Derived classes must implement this method to remove the state of
DelegationToken Master Key
|
void |
serviceInit(Configuration conf)
All initialization code needed by a service.
|
protected void |
serviceStart()
Actions called during the INITED to STARTED transition.
|
void |
serviceStop()
Actions called during the transition to the STOPPED state.
|
void |
setRMDispatcher(Dispatcher dispatcher)
Dispatcher used to send state operation completion events to
ResourceManager services
|
protected abstract void |
startInternal()
Derived classes start themselves using this method.
|
void |
storeApplication(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 |
storeApplicationAttempt(RMAppAttempt appAttempt) |
protected abstract void |
storeApplicationAttemptState(String attemptId,
ApplicationAttemptStateDataPBImpl attemptStateData)
Blocking API
Derived classes must implement this method to store the state of an
application attempt
|
protected abstract void |
storeApplicationState(String appId,
ApplicationStateDataPBImpl appStateData)
Blocking API
Derived classes must implement this method to store the state of an
application.
|
void |
storeRMDelegationTokenAndSequenceNumber(RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
RMDTSecretManager call this to store the state of a delegation token
and sequence number
|
protected abstract void |
storeRMDelegationTokenAndSequenceNumberState(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(DelegationKey delegationKey)
RMDTSecretManager call this to store the state of a master key
|
protected abstract void |
storeRMDTMasterKeyState(DelegationKey delegationKey)
Blocking API
Derived classes must implement this method to store the state of
DelegationToken Master Key
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public static final org.apache.commons.logging.Log LOG
public static final Text AM_RM_TOKEN_SERVICE
public static final Text AM_CLIENT_TOKEN_MASTER_KEY_NAME
public void setRMDispatcher(Dispatcher dispatcher)
public void serviceInit(Configuration conf) throws Exception
AbstractService
AbstractService.init(Configuration)
prevents re-entrancy.
The base implementation checks to see if the subclass has created
a new configuration instance, and if so, updates the base class valueserviceInit
in class AbstractService
conf
- configurationException
- on a failure -these will be caught,
possibly wrapped, and wil; trigger a service stopprotected void serviceStart() throws Exception
AbstractService
AbstractService.start()
prevents re-entrancy.serviceStart
in class AbstractService
Exception
- if needed -these will be caught,
wrapped, and trigger a service stopprotected abstract void initInternal(Configuration conf) throws Exception
Exception
protected abstract void startInternal() throws Exception
Exception
public void serviceStop() throws Exception
AbstractService
AbstractService.stop()
prevents re-entrancy.
Implementations MUST write this to be robust against failures, including
checks for null references -and for the first failure to not stop other
attempts to shut down parts of the service.serviceStop
in class AbstractService
Exception
- if needed -these will be caught and logged.protected abstract void closeInternal() throws Exception
Exception
public abstract RMStateStore.RMState loadState() throws Exception
Exception
public void storeApplication(RMApp app)
protected abstract void storeApplicationState(String appId, ApplicationStateDataPBImpl appStateData) throws Exception
Exception
public void storeApplicationAttempt(RMAppAttempt appAttempt)
protected abstract void storeApplicationAttemptState(String attemptId, ApplicationAttemptStateDataPBImpl attemptStateData) throws Exception
Exception
public void storeRMDelegationTokenAndSequenceNumber(RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate, int latestSequenceNumber) throws Exception
Exception
protected abstract void storeRMDelegationTokenAndSequenceNumberState(RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate, int latestSequenceNumber) throws Exception
Exception
public void removeRMDelegationToken(RMDelegationTokenIdentifier rmDTIdentifier, int sequenceNumber) throws Exception
Exception
protected abstract void removeRMDelegationTokenState(RMDelegationTokenIdentifier rmDTIdentifier) throws Exception
Exception
public void storeRMDTMasterKey(DelegationKey delegationKey) throws Exception
Exception
protected abstract void storeRMDTMasterKeyState(DelegationKey delegationKey) throws Exception
Exception
public void removeRMDTMasterKey(DelegationKey delegationKey) throws Exception
Exception
protected abstract void removeRMDTMasterKeyState(DelegationKey delegationKey) throws Exception
Exception
public void removeApplication(RMApp app)
public void removeApplication(RMStateStore.ApplicationState appState)
protected abstract void removeApplicationState(RMStateStore.ApplicationState appState) throws Exception
Exception
Copyright © 2013 Apache Software Foundation. All rights reserved.