@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class RMStateStore
extends org.apache.hadoop.service.AbstractService
Modifier and Type | Class and Description |
---|---|
static class |
RMStateStore.ProxyCAState |
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 |
PROXY_CA_CERT_NODE |
protected static String |
PROXY_CA_PRIVATE_KEY_NODE |
protected static String |
PROXY_CA_ROOT |
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.
|
void |
storeProxyCACert(X509Certificate caCert,
PrivateKey caPrivateKey)
ProxyCAManager calls this to store the CA Certificate and Private Key.
|
protected abstract void |
storeProxyCACertState(X509Certificate caCert,
PrivateKey caPrivateKey)
Blocking API
Derived classes must implement this method to store the CA Certificate
and Private 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,
org.apache.hadoop.thirdparty.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
@VisibleForTesting 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 PROXY_CA_ROOT
protected static final String PROXY_CA_CERT_NODE
protected static final String PROXY_CA_PRIVATE_KEY_NODE
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
@VisibleForTesting 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)
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
conf
- Configuration.Exception
- error occur.protected abstract void startInternal() throws Exception
Exception
- error occur.protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
protected abstract void closeInternal() throws Exception
Exception
- error occur.public void checkVersion() throws Exception
Exception
- error occur.protected abstract org.apache.hadoop.yarn.server.records.Version loadVersion() throws Exception
Exception
- error occur.protected abstract void storeVersion() throws Exception
Exception
- error occur.protected abstract org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
public abstract long getAndIncrementEpoch() throws Exception
Exception
- error occur.protected long nextEpoch(long epoch)
epoch
- epoch value.public abstract RMStateStore.RMState loadState() throws Exception
Exception
- error occur.public void storeNewApplication(RMApp app)
app
- rmApp.public void updateApplicationState(ApplicationStateData appState)
public void updateApplicationState(ApplicationStateData appState, boolean notifyApp)
public void updateApplicationStateSynchronously(ApplicationStateData appState, boolean notifyApp, org.apache.hadoop.thirdparty.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
appId
- application Id.appStateData
- application StateData.Exception
- error occur.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
attemptId
- Application AttemptId.attemptStateData
- Application AttemptStateData.Exception
- error occur.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)
rmDTIdentifier
- RMDelegationTokenIdentifier.renewDate
- token renew date.protected abstract void storeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception
rmDTIdentifier
- RMDelegationTokenIdentifier.renewDate
- token renew date.Exception
- error occur.public void removeRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
rmDTIdentifier
- RMDelegationTokenIdentifier.protected abstract void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier) throws Exception
rmDTIdentifier
- RMDelegationTokenIdentifier.Exception
- error occurs.public void updateRMDelegationToken(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate)
rmDTIdentifier
- RMDelegationTokenIdentifier.renewDate
- token renew date.protected abstract void updateRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception
rmDTIdentifier
- RMDelegationTokenIdentifier.renewDate
- token renew date.Exception
- error occurs.public void storeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
delegationKey
- DelegationToken Master Key.protected abstract void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception
delegationKey
- DelegationToken Master Key.Exception
- error occur.public void removeRMDTMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
delegationKey
- DelegationToken Master Key.public void storeNewReservation(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation, String planName, String reservationIdName)
reservationAllocation
- reservation Allocation.planName
- plan Name.reservationIdName
- reservationId Name.protected abstract void storeReservationState(org.apache.hadoop.yarn.proto.YarnProtos.ReservationAllocationStateProto reservationAllocation, String planName, String reservationIdName) throws Exception
reservationAllocation
- reservation Allocation.planName
- plan Name.reservationIdName
- reservationId Name.Exception
- error occurs.protected abstract void removeReservationState(String planName, String reservationIdName) throws Exception
planName
- plan Name.reservationIdName
- reservationId Name.Exception
- exception occurs.protected abstract void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception
delegationKey
- DelegationKey.Exception
- exception occurs.protected abstract void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate) throws Exception
amrmTokenSecretManagerState
- amrmTokenSecretManagerState.isUpdate
- true, update; otherwise not update.Exception
- exception occurs.public void storeOrUpdateAMRMTokenSecretManager(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate)
amrmTokenSecretManagerState
- amrmTokenSecretManagerState.isUpdate
- true, update; otherwise not update.public void removeApplication(RMApp app)
app
- RMApp.protected abstract void removeApplicationStateInternal(ApplicationStateData appState) throws Exception
appState
- ApplicationStateData.Exception
- error occurs.public void removeApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
applicationAttemptId
- applicationAttemptId.protected abstract void removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId) throws Exception
attemptId
- application attempt id.Exception
- exception occurs.public org.apache.hadoop.security.Credentials getCredentialsFromAppAttempt(RMAppAttempt appAttempt)
@VisibleForTesting 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
- exception occurs.public abstract void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId removeAppId) throws Exception
removeAppId
- application Id.Exception
- exception occurs.public void setResourceManager(ResourceManager rm)
public RMStateStore.RMStateStoreState getRMStateStoreState()
protected org.apache.hadoop.yarn.event.EventHandler getRMStateStoreEventHandler()
public void storeProxyCACert(X509Certificate caCert, PrivateKey caPrivateKey)
caCert
- X509Certificate.caPrivateKey
- PrivateKey.protected abstract void storeProxyCACertState(X509Certificate caCert, PrivateKey caPrivateKey) throws Exception
caCert
- X509Certificate.caPrivateKey
- PrivateKey.Exception
- error occurs.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.