@InterfaceAudience.Private @InterfaceStability.Unstable public class ZKRMStateStore extends RMStateStore
RMStateStore.RMDTSecretManagerState, RMStateStore.RMState
Modifier and Type | Field and Description |
---|---|
static int |
CREATE_DELETE_PERMS |
protected static org.apache.hadoop.yarn.server.records.Version |
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, AMRMTOKEN_SECRET_MANAGER_ROOT, DELEGATION_KEY_PREFIX, DELEGATION_TOKEN_PREFIX, DELEGATION_TOKEN_SEQUENCE_NUMBER_PREFIX, EPOCH_NODE, 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 ACL s used (zkAcl) for
ZooKeeper access, construct the ACL s for the store's root node. |
void |
createWithRetries(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
org.apache.zookeeper.CreateMode mode) |
void |
deleteStore()
Derived classes must implement this method to delete the state store
|
long |
getAndIncrementEpoch()
Get the current epoch of RM and increment the value.
|
protected org.apache.hadoop.yarn.server.records.Version |
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 org.apache.hadoop.yarn.server.records.Version |
loadVersion()
Derived class use this method to load the version information from state
store.
|
void |
processWatchEvent(org.apache.zookeeper.ZooKeeper zk,
org.apache.zookeeper.WatchedEvent event) |
void |
removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
Blocking API
Derived classes must implement this method to remove the state of specified
attempt.
|
void |
removeApplicationStateInternal(ApplicationStateData 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,
ApplicationAttemptStateData 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,
ApplicationStateData appStateDataPB)
Blocking API
Derived classes must implement this method to store the state of an
application.
|
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 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
|
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,
ApplicationAttemptStateData attemptStateDataPB) |
void |
updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId,
ApplicationStateData appStateDataPB) |
protected 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
|
checkVersion, getCredentialsFromAppAttempt, getRMStateStoreState, handleStoreEvent, isFencedState, notifyStoreOperationFailed, removeApplication, removeApplicationAttempt, removeRMDelegationToken, removeRMDTMasterKey, serviceInit, serviceStart, serviceStop, setResourceManager, setRMDispatcher, storeNewApplication, storeNewApplicationAttempt, storeOrUpdateAMRMTokenSecretManager, storeRMDelegationToken, storeRMDTMasterKey, updateApplicationAttemptState, updateApplicationState, updateFencedState, updateRMDelegationToken
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
protected static final String ROOT_ZNODE_NAME
protected static final org.apache.hadoop.yarn.server.records.Version 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 ACL
s used (zkAcl) for
ZooKeeper access, construct the ACL
s 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.NoSuchAlgorithmException
public void initInternal(org.apache.hadoop.conf.Configuration conf) throws Exception
RMStateStore
initInternal
in class RMStateStore
Exception
public void startInternal() throws Exception
RMStateStore
startInternal
in class RMStateStore
Exception
protected void closeInternal() throws Exception
RMStateStore
closeInternal
in class RMStateStore
Exception
protected org.apache.hadoop.yarn.server.records.Version getCurrentVersion()
RMStateStore
getCurrentVersion
in class RMStateStore
protected void storeVersion() throws Exception
RMStateStore
storeVersion
in class RMStateStore
Exception
protected org.apache.hadoop.yarn.server.records.Version loadVersion() throws Exception
RMStateStore
loadVersion
in class RMStateStore
Exception
public long getAndIncrementEpoch() throws Exception
RMStateStore
getAndIncrementEpoch
in class RMStateStore
Exception
public RMStateStore.RMState loadState() throws Exception
RMStateStore
loadState
in class RMStateStore
Exception
public void storeApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateDataPB) throws Exception
RMStateStore
storeApplicationStateInternal
in class RMStateStore
Exception
public void updateApplicationStateInternal(org.apache.hadoop.yarn.api.records.ApplicationId appId, ApplicationStateData appStateDataPB) throws Exception
updateApplicationStateInternal
in class RMStateStore
Exception
public void storeApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, ApplicationAttemptStateData attemptStateDataPB) throws Exception
RMStateStore
storeApplicationAttemptStateInternal
in class RMStateStore
Exception
public void updateApplicationAttemptStateInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, ApplicationAttemptStateData attemptStateDataPB) throws Exception
updateApplicationAttemptStateInternal
in class RMStateStore
Exception
public void removeApplicationAttemptInternal(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) throws Exception
RMStateStore
removeApplicationAttemptInternal
in class RMStateStore
Exception
public void removeApplicationStateInternal(ApplicationStateData appState) throws Exception
RMStateStore
removeApplicationStateInternal
in class RMStateStore
Exception
protected void storeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception
RMStateStore
storeRMDelegationTokenState
in class RMStateStore
Exception
protected void removeRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier) throws Exception
RMStateStore
removeRMDelegationTokenState
in class RMStateStore
Exception
protected void updateRMDelegationTokenState(org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier rmDTIdentifier, Long renewDate) throws Exception
RMStateStore
updateRMDelegationTokenState
in class RMStateStore
Exception
protected void storeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception
RMStateStore
storeRMDTMasterKeyState
in class RMStateStore
Exception
protected void removeRMDTMasterKeyState(org.apache.hadoop.security.token.delegation.DelegationKey delegationKey) throws Exception
RMStateStore
removeRMDTMasterKeyState
in class RMStateStore
Exception
public void deleteStore() throws Exception
RMStateStore
deleteStore
in class RMStateStore
Exception
@InterfaceAudience.Private @InterfaceStability.Unstable public void processWatchEvent(org.apache.zookeeper.ZooKeeper zk, 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
IOException
InterruptedException
public void storeOrUpdateAMRMTokenSecretManagerState(AMRMTokenSecretManagerState amrmTokenSecretManagerState, boolean isUpdate) throws Exception
RMStateStore
storeOrUpdateAMRMTokenSecretManagerState
in class RMStateStore
Exception
Copyright © 2017 Apache Software Foundation. All Rights Reserved.