@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class RMStateStore
extends org.apache.hadoop.service.AbstractService
Modifier and Type | Class and Description |
---|---|
static class |
RMStateStore.RMDTSecretManagerState |
static class |
RMStateStore.RMState
State of the ResourceManager
|
static class |
RMStateStore.RMStateStoreState
The enum defines state of RMStateStore.
|
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 |
AMRMTOKEN_SECRET_MANAGER_ROOT |
protected long |
baseEpoch |
protected static String |
DELEGATION_KEY_PREFIX |
protected static String |
DELEGATION_TOKEN_PREFIX |
protected static String |
DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX |
protected static String |
EPOCH_NODE |
static org.slf4j.Logger |
LOG |
protected static String |
RESERVATION_SYSTEM_ROOT |
protected ResourceManager |
resourceManager |
static String |
RM_APP_ROOT |
protected static String |
RM_DELEGATION_TOKENS_ROOT_ZNODE_NAME |
protected static String |
RM_DT_SECRET_MANAGER_ROOT |
protected org.apache.hadoop.yarn.event.EventHandler |
rmStateStoreEventHandler |
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.
|
abstract void |
deleteStore()
Derived classes must implement this method to delete the state store
|
abstract long |
getAndIncrementEpoch()
Get the current epoch of RM and increment the value.
|
org.apache.hadoop.security.Credentials |
getCredentialsFromAppAttempt(RMAppAttempt appAttempt) |
protected abstract org.apache.hadoop.yarn.server.records.Version |
getCurrentVersion()
Get the current version of the underlying state store.
|
protected org.apache.hadoop.yarn.event.EventHandler |
getRMStateStoreEventHandler() |
RMStateStore.RMStateStoreState |
getRMStateStoreState() |
protected void |
handleStoreEvent(RMStateStoreEvent event) |
protected abstract void |
initInternal(org.apache.hadoop.conf.Configuration conf)
Derived classes initialize themselves using this method.
|
protected boolean |
isFencedState() |
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 org.apache.hadoop.yarn.server.records.Version |
loadVersion()
Derived class use this method to load the version information from state
store.
|
protected long |
nextEpoch(long epoch)
Compute the next epoch value by incrementing by one.
|
protected void |
notifyStoreOperationFailed(Exception failureCause)
This method is called to notify the ResourceManager that the store
operation has failed.
|
abstract void |
removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId removeAppId)
Derived classes must implement this method to remove application from the
state store
|
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 |
removeApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
Non-blocking API
ResourceManager services call this to remove an attempt from the state
store
This does not block the dispatcher threads
There is no notification of completion for this operation.
|
protected abstract void |
removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId)
Blocking API
Derived classes must implement this method to remove the state of specified
attempt.
|
protected abstract void |
removeApplicationStateInternal(ApplicationStateData appState)
Blocking API
Derived classes must implement this method to remove the state of an
application and its attempts
|
void |
removeReservation(String planName,
String reservationIdName) |
protected abstract void |
removeReservationState(String planName,
String reservationIdName)
Blocking API
Derived classes must implement this method to remove the state of
a reservation allocation.
|
void |
removeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
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 |
setResourceManager(ResourceManager rm) |
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,
ApplicationAttemptStateData 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,
ApplicationStateData 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 |
storeNewReservation(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation,
String planName,
String reservationIdName)
Blocking Apis to maintain reservation state.
|
void |
storeOrUpdateAMRMTokenSecretManager(AMRMTokenSecretManagerState amrmTokenSecretManagerState,
boolean isUpdate)
Store or Update state of AMRMToken Master Key
|
protected abstract void |
storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState,
boolean isUpdate)
Blocking API Derived classes must implement this method to store or update
the state of AMRMToken Master Key
|
protected abstract void |
storeReservationState(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.
|
void |
storeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate)
RMDTSecretManager call this to store the state of a delegation token
and sequence number
|
protected abstract void |
storeRMDelegationTokenState(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
|
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(ApplicationAttemptStateData attemptState) |
protected abstract void |
updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId,
ApplicationAttemptStateData attemptStateData) |
void |
updateApplicationState(ApplicationStateData appState) |
void |
updateApplicationState(ApplicationStateData appState,
boolean notifyApp) |
protected abstract void |
updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateData appStateData) |
void |
updateApplicationStateSynchronously(ApplicationStateData appState,
boolean notifyApp,
com.google.common.util.concurrent.SettableFuture<Object> resultFuture) |
void |
updateFencedState() |
void |
updateRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate)
RMDTSecretManager call this to update the state of a delegation token
and sequence number
|
protected abstract void |
updateRMDelegationTokenState(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
|
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 String RM_APP_ROOT
protected static final String RM_DT_SECRET_MANAGER_ROOT
protected static final String RM_DELEGATION_TOKENS_ROOT_ZNODE_NAME
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 AMRMTOKEN_SECRET_MANAGER_ROOT
protected static final String RESERVATION_SYSTEM_ROOT
protected static final String VERSION_NODE
protected static final String EPOCH_NODE
protected long baseEpoch
protected ResourceManager resourceManager
public static final org.slf4j.Logger LOG
protected org.apache.hadoop.yarn.event.EventHandler rmStateStoreEventHandler
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.AbstractService
Exception
protected void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
protected abstract void initInternal(org.apache.hadoop.conf.Configuration conf) throws Exception
Exception
protected abstract void startInternal() throws Exception
Exception
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
protected abstract void closeInternal() throws Exception
Exception
public void checkVersion() throws Exception
Exception
protected abstract org.apache.hadoop.yarn.server.records.Version loadVersion() throws Exception
Exception
protected abstract void storeVersion() throws Exception
Exception
protected abstract org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
public abstract long getAndIncrementEpoch() throws Exception
Exception
protected long nextEpoch(long epoch)
public abstract RMStateStore.RMState loadState() throws Exception
Exception
public void storeNewApplication(RMApp app)
public void updateApplicationState(ApplicationStateData appState)
public void updateApplicationState(ApplicationStateData appState, boolean notifyApp)
public void updateApplicationStateSynchronously(ApplicationStateData appState, boolean notifyApp, com.google.common.util.concurrent.SettableFuture<Object> resultFuture)
public void updateFencedState()
protected abstract void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) throws Exception
Exception
protected abstract void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateData) throws Exception
Exception
public void storeNewApplicationAttempt(RMAppAttempt appAttempt)
public void updateApplicationAttemptState(ApplicationAttemptStateData attemptState)
protected abstract void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) throws Exception
Exception
protected abstract void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId, ApplicationAttemptStateData attemptStateData) throws Exception
Exception
public void storeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate)
protected abstract void storeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception
Exception
public void removeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
protected abstract void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier) throws Exception
Exception
public void updateRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate)
protected abstract void updateRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception
Exception
public void storeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
protected abstract void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception
Exception
public void removeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
public void storeNewReservation(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation, String planName, String reservationIdName)
protected abstract void storeReservationState(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation, String planName, String reservationIdName) throws Exception
Exception
protected abstract void removeReservationState(String planName, String reservationIdName) throws Exception
Exception
protected abstract void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception
Exception
protected abstract void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate) throws Exception
Exception
public void storeOrUpdateAMRMTokenSecretManager(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate)
public void removeApplication(RMApp app)
protected abstract void removeApplicationStateInternal(ApplicationStateData appState) throws Exception
Exception
public void removeApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
protected abstract void removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) throws Exception
Exception
public org.apache.hadoop.security.Credentials getCredentialsFromAppAttempt(RMAppAttempt appAttempt)
protected boolean isFencedState()
protected void handleStoreEvent(RMStateStoreEvent event)
protected void notifyStoreOperationFailed(Exception failureCause)
failureCause
- the exception due to which the operation failedpublic abstract void deleteStore() throws Exception
Exception
public abstract void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId removeAppId) throws Exception
Exception
public void setResourceManager(ResourceManager rm)
public RMStateStore.RMStateStoreState getRMStateStoreState()
protected org.apache.hadoop.yarn.event.EventHandler getRMStateStoreEventHandler()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.