@InterfaceAudience.Private @InterfaceStability.Unstable public class ZKRMStateStore extends RMStateStore
RMStateStore.ApplicationAttemptState, RMStateStore.ApplicationState, RMStateStore.RMDTSecretManagerState, RMStateStore.RMState| Modifier and Type | Field and Description |
|---|---|
static int |
CREATE_DELETE_PERMS |
protected static RMStateVersion |
CURRENT_VERSION_INFO |
static org.apache.commons.logging.Log |
LOG |
protected static String |
ROOT_ZNODE_NAME |
protected org.apache.zookeeper.ZooKeeper |
zkClient |
protected String |
znodeWorkingPath |
AM_CLIENT_TOKEN_MASTER_KEY_NAME, AM_RM_TOKEN_SERVICE, DELEGATION_KEY_PREFIX, DELEGATION_TOKEN_PREFIX, DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX, RM_APP_ROOT, RM_DT_SECRET_MANAGER_ROOT, VERSION_NODE| Constructor and Description |
|---|
ZKRMStateStore() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeInternal()
Derived classes close themselves using this method.
|
protected List<org.apache.zookeeper.data.ACL> |
constructZkRootNodeACL(org.apache.hadoop.conf.Configuration conf,
List<org.apache.zookeeper.data.ACL> sourceACLs)
Given the
Configuration and ACLs used (zkAcl) for
ZooKeeper access, construct the ACLs for the store's root node. |
void |
createWithRetries(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
org.apache.zookeeper.CreateMode mode) |
protected RMStateVersion |
getCurrentVersion()
Get the current version of the underlying state store.
|
byte[] |
getDataWithRetries(String path,
boolean watch) |
protected org.apache.zookeeper.ZooKeeper |
getNewZooKeeper() |
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 RMStateVersion |
loadVersion()
Derived class use this method to load the version information from state
store.
|
void |
processWatchEvent(org.apache.zookeeper.WatchedEvent event) |
void |
removeApplicationStateInternal(RMStateStore.ApplicationState appState)
Blocking API
Derived classes must implement this method to remove the state of an
application and its attempts
|
protected void |
removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
Blocking API
Derived classes must implement this method to remove the state of RMDelegationToken
|
protected 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
|
void |
setDataWithRetries(String path,
byte[] data,
int version) |
void |
startInternal()
Derived classes start themselves using this method.
|
void |
storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
ApplicationAttemptStateDataPBImpl attemptStateDataPB)
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,
ApplicationStateDataPBImpl appStateDataPB)
Blocking API
Derived classes must implement this method to store the state of an
application.
|
protected 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
|
protected 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,
ApplicationAttemptStateDataPBImpl attemptStateDataPB) |
void |
updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateDataPB) |
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
|
checkVersion, getCredentialsFromAppAttempt, handleStoreEvent, notifyStoreOperationFailed, removeApplication, removeRMDelegationToken, removeRMDTMasterKey, serviceInit, serviceStart, serviceStop, setRMDispatcher, storeNewApplication, storeNewApplicationAttempt, storeRMDelegationTokenAndSequenceNumber, storeRMDTMasterKey, updateApplicationAttemptState, updateApplicationState, updateRMDelegationTokenAndSequenceNumberclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic static final org.apache.commons.logging.Log LOG
protected static final String ROOT_ZNODE_NAME
protected static final RMStateVersion CURRENT_VERSION_INFO
protected String znodeWorkingPath
protected org.apache.zookeeper.ZooKeeper zkClient
public static final int CREATE_DELETE_PERMS
@InterfaceAudience.Private @InterfaceStability.Unstable protected List<org.apache.zookeeper.data.ACL> constructZkRootNodeACL(org.apache.hadoop.conf.Configuration conf, List<org.apache.zookeeper.data.ACL> sourceACLs) throws NoSuchAlgorithmException
Configuration and ACLs used (zkAcl) for
ZooKeeper access, construct the ACLs for the store's root node.
In the constructed ACL, all the users allowed by zkAcl are given
rwa access, while the current RM has exclude create-delete access.
To be called only when HA is enabled and the configuration doesn't set ACL
for the root node.NoSuchAlgorithmExceptionpublic void initInternal(org.apache.hadoop.conf.Configuration conf)
throws Exception
RMStateStoreinitInternal in class RMStateStoreExceptionpublic void startInternal()
throws Exception
RMStateStorestartInternal in class RMStateStoreExceptionprotected void closeInternal()
throws Exception
RMStateStorecloseInternal in class RMStateStoreExceptionprotected RMStateVersion getCurrentVersion()
RMStateStoregetCurrentVersion in class RMStateStoreprotected void storeVersion()
throws Exception
RMStateStorestoreVersion in class RMStateStoreExceptionprotected RMStateVersion loadVersion() throws Exception
RMStateStoreloadVersion in class RMStateStoreExceptionpublic RMStateStore.RMState loadState() throws Exception
RMStateStoreloadState in class RMStateStoreExceptionpublic void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateDataPB)
throws Exception
RMStateStorestoreApplicationStateInternal in class RMStateStoreExceptionpublic void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateDataPBImpl appStateDataPB)
throws Exception
updateApplicationStateInternal in class RMStateStoreExceptionpublic void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
ApplicationAttemptStateDataPBImpl attemptStateDataPB)
throws Exception
RMStateStorestoreApplicationAttemptStateInternal in class RMStateStoreExceptionpublic void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
ApplicationAttemptStateDataPBImpl attemptStateDataPB)
throws Exception
updateApplicationAttemptStateInternal in class RMStateStoreExceptionpublic void removeApplicationStateInternal(RMStateStore.ApplicationState appState) throws Exception
RMStateStoreremoveApplicationStateInternal in class RMStateStoreExceptionprotected void storeRMDelegationTokenAndSequenceNumberState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
throws Exception
RMStateStorestoreRMDelegationTokenAndSequenceNumberState in class RMStateStoreExceptionprotected void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier)
throws Exception
RMStateStoreremoveRMDelegationTokenState in class RMStateStoreExceptionprotected void updateRMDelegationTokenAndSequenceNumberInternal(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier,
Long renewDate,
int latestSequenceNumber)
throws Exception
RMStateStoreupdateRMDelegationTokenAndSequenceNumberInternal in class RMStateStoreExceptionprotected void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
throws Exception
RMStateStorestoreRMDTMasterKeyState in class RMStateStoreExceptionprotected void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey)
throws Exception
RMStateStoreremoveRMDTMasterKeyState in class RMStateStoreException@InterfaceAudience.Private
@InterfaceStability.Unstable
public void processWatchEvent(org.apache.zookeeper.WatchedEvent event)
throws Exception
Exception@InterfaceAudience.Private @InterfaceStability.Unstable public void createWithRetries(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl, org.apache.zookeeper.CreateMode mode) throws Exception
Exception@InterfaceAudience.Private @InterfaceStability.Unstable public void setDataWithRetries(String path, byte[] data, int version) throws Exception
Exception@InterfaceAudience.Private @InterfaceStability.Unstable public byte[] getDataWithRetries(String path, boolean watch) throws Exception
Exception@InterfaceAudience.Private
@InterfaceStability.Unstable
protected org.apache.zookeeper.ZooKeeper getNewZooKeeper()
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionCopyright © 2014 Apache Software Foundation. All Rights Reserved.