@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class NMStateStoreService
extends org.apache.hadoop.service.AbstractService
Modifier and Type | Class and Description |
---|---|
static class |
NMStateStoreService.LocalResourceTrackerState |
static class |
NMStateStoreService.RecoveredAMRMProxyState
Recovered states for AMRMProxy.
|
static class |
NMStateStoreService.RecoveredApplicationsState |
static class |
NMStateStoreService.RecoveredContainerState |
static class |
NMStateStoreService.RecoveredContainerStatus |
static class |
NMStateStoreService.RecoveredContainerTokensState |
static class |
NMStateStoreService.RecoveredContainerType
Type of post recovery action.
|
static class |
NMStateStoreService.RecoveredDeletionServiceState |
static class |
NMStateStoreService.RecoveredLocalizationState |
static class |
NMStateStoreService.RecoveredLogDeleterState |
static class |
NMStateStoreService.RecoveredNMTokensState |
static class |
NMStateStoreService.RecoveredUserResources |
Constructor and Description |
---|
NMStateStoreService(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRecover() |
protected abstract void |
closeStorage() |
abstract void |
finishResourceLocalization(String user,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.LocalizedResourceProto proto)
Record the completion of a resource localization
|
abstract RecoveryIterator<NMStateStoreService.RecoveredContainerState> |
getContainerStateIterator()
get the Recovered Container State Iterator
|
protected NodeStatusUpdater |
getNodeStatusUpdater() |
protected abstract void |
initStorage(org.apache.hadoop.conf.Configuration conf) |
boolean |
isNewlyCreated() |
abstract NMStateStoreService.RecoveredAMRMProxyState |
loadAMRMProxyState()
Load the state of AMRMProxy.
|
abstract NMStateStoreService.RecoveredApplicationsState |
loadApplicationsState()
Load the state of applications.
|
abstract NMStateStoreService.RecoveredContainerTokensState |
loadContainerTokensState()
Load the state of container tokens
|
abstract NMStateStoreService.RecoveredDeletionServiceState |
loadDeletionServiceState()
Load the state of the deletion service
|
abstract NMStateStoreService.RecoveredLocalizationState |
loadLocalizationState()
Load the state of localized resources
|
abstract NMStateStoreService.RecoveredLogDeleterState |
loadLogDeleterState()
Load the state of log deleters
|
abstract NMStateStoreService.RecoveredNMTokensState |
loadNMTokensState()
Load the state of NM tokens
|
abstract void |
removeAMRMProxyAppContext(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt)
Remove the entire context map for an application attempt in
AMRMProxyService.
|
abstract void |
removeAMRMProxyAppContextEntry(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt,
String key)
Remove a context entry for an application attempt in AMRMProxyService.
|
abstract void |
removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Remove records corresponding to an application
|
abstract void |
removeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Remove records corresponding to a container
|
abstract void |
removeContainerPaused(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Record that a container has been resumed at the NM by removing the
fact that it has be paused.
|
abstract void |
removeContainerToken(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Remove records for a container token
|
abstract void |
removeDeletionTask(int taskId)
Remove records corresponding to a deletion task
|
abstract void |
removeLocalizedResource(String user,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.fs.Path localPath)
Remove records related to a resource localization
|
abstract void |
removeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Remove the state of a log deleter
|
abstract void |
removeNMTokenApplicationMasterKey(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt)
Remove a master key corresponding to an application
|
void |
serviceInit(org.apache.hadoop.conf.Configuration conf)
Initialize the state storage
|
void |
serviceStart()
Start the state storage for use
|
void |
serviceStop()
Shutdown the state storage.
|
void |
setNodeStatusUpdater(NodeStatusUpdater nodeStatusUpdater) |
abstract void |
startResourceLocalization(String user,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnProtos.LocalResourceProto proto,
org.apache.hadoop.fs.Path localPath)
Record the start of localization for a resource
|
protected abstract void |
startStorage() |
abstract void |
storeAMRMProxyAppContextEntry(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt,
String key,
byte[] data)
Add a context entry for an application attempt in AMRMProxyService.
|
abstract void |
storeAMRMProxyCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record the current AMRMProxyTokenSecretManager master key.
|
abstract void |
storeAMRMProxyNextMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record the next AMRMProxyTokenSecretManager master key.
|
abstract void |
storeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto p)
Record the start of an application
|
abstract void |
storeAssignedResources(Container container,
String resourceType,
List<Serializable> assignedResources)
Store the assigned resources to a container.
|
abstract void |
storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int containerVersion,
long startTime,
org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest startRequest)
Record a container start request
|
abstract void |
storeContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int exitCode)
Record that a container has completed
|
abstract void |
storeContainerDiagnostics(org.apache.hadoop.yarn.api.records.ContainerId containerId,
StringBuilder diagnostics)
Record diagnostics for a container
|
abstract void |
storeContainerKilled(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Record a request to kill a container
|
abstract void |
storeContainerLaunched(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Record that a container has been launched
|
abstract void |
storeContainerLogDir(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String logDir)
Record log directory for a container.
|
abstract void |
storeContainerPaused(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Record that a container has been paused at the NM.
|
abstract void |
storeContainerQueued(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Record that a container has been queued at the NM
|
abstract void |
storeContainerRemainingRetryAttempts(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int remainingRetryAttempts)
Record remaining retry attempts for a container.
|
abstract void |
storeContainerRestartTimes(org.apache.hadoop.yarn.api.records.ContainerId containerId,
List<Long> restartTimes)
Record restart times for a container.
|
abstract void |
storeContainerToken(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Long expirationTime)
Record the expiration time for a container token
|
abstract void |
storeContainerTokenCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record the current container token master key
|
abstract void |
storeContainerTokenPreviousMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record the previous container token master key
|
abstract void |
storeContainerUpdateToken(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier)
Record that a container has been updated
|
abstract void |
storeContainerWorkDir(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String workDir)
Record working directory for a container.
|
abstract void |
storeDeletionTask(int taskId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto taskProto)
Record a deletion task
|
abstract void |
storeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.LogDeleterProto proto)
Store the state of a log deleter
|
abstract void |
storeNMTokenApplicationMasterKey(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt,
org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record a master key corresponding to an application
|
abstract void |
storeNMTokenCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record the current NM token master key
|
abstract void |
storeNMTokenPreviousMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
Record the previous NM token master key
|
protected void |
updateContainerResourceMapping(Container container,
String resourceType,
List<Serializable> assignedResources) |
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public NMStateStoreService(String name)
protected NodeStatusUpdater getNodeStatusUpdater()
public void setNodeStatusUpdater(NodeStatusUpdater nodeStatusUpdater)
public void serviceInit(org.apache.hadoop.conf.Configuration conf) throws IOException
serviceInit
in class org.apache.hadoop.service.AbstractService
IOException
public void serviceStart() throws IOException
serviceStart
in class org.apache.hadoop.service.AbstractService
IOException
public void serviceStop() throws IOException
serviceStop
in class org.apache.hadoop.service.AbstractService
IOException
public boolean canRecover()
public boolean isNewlyCreated()
public abstract NMStateStoreService.RecoveredApplicationsState loadApplicationsState() throws IOException
IOException
- IO Exception.public abstract void storeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto p) throws IOException
appId
- the application IDp
- state to store for the applicationIOException
public abstract void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
appId
- the application IDIOException
public abstract RecoveryIterator<NMStateStoreService.RecoveredContainerState> getContainerStateIterator() throws IOException
IOException
public abstract void storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, int containerVersion, long startTime, org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest startRequest) throws IOException
containerId
- the container IDcontainerVersion
- the container VersionstartTime
- container start timestartRequest
- the container start requestIOException
public abstract void storeContainerQueued(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container IDIOException
public abstract void storeContainerPaused(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container ID.IOException
- IO Exception.public abstract void removeContainerPaused(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container ID.IOException
- IO Exception.public abstract void storeContainerLaunched(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container IDIOException
public abstract void storeContainerUpdateToken(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier) throws IOException
containerId
- the container IDcontainerTokenIdentifier
- container token identifierIOException
public abstract void storeContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerId containerId, int exitCode) throws IOException
containerId
- the container IDexitCode
- the exit code from the containerIOException
public abstract void storeContainerKilled(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container IDIOException
public abstract void storeContainerDiagnostics(org.apache.hadoop.yarn.api.records.ContainerId containerId, StringBuilder diagnostics) throws IOException
containerId
- the container IDdiagnostics
- the container diagnosticsIOException
public abstract void storeContainerRemainingRetryAttempts(org.apache.hadoop.yarn.api.records.ContainerId containerId, int remainingRetryAttempts) throws IOException
containerId
- the container IDremainingRetryAttempts
- the remain retry times when container
fails to runIOException
public abstract void storeContainerRestartTimes(org.apache.hadoop.yarn.api.records.ContainerId containerId, List<Long> restartTimes) throws IOException
containerId
- restartTimes
- IOException
public abstract void storeContainerWorkDir(org.apache.hadoop.yarn.api.records.ContainerId containerId, String workDir) throws IOException
containerId
- the container IDworkDir
- the working directoryIOException
public abstract void storeContainerLogDir(org.apache.hadoop.yarn.api.records.ContainerId containerId, String logDir) throws IOException
containerId
- the container IDlogDir
- the log directoryIOException
public abstract void removeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container IDIOException
public abstract NMStateStoreService.RecoveredLocalizationState loadLocalizationState() throws IOException
IOException
public abstract void startResourceLocalization(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.proto.YarnProtos.LocalResourceProto proto, org.apache.hadoop.fs.Path localPath) throws IOException
user
- the username or null if the resource is publicappId
- the application ID if the resource is app-specific or nullproto
- the resource requestlocalPath
- local filesystem path where the resource will be storedIOException
public abstract void finishResourceLocalization(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.LocalizedResourceProto proto) throws IOException
user
- the username or null if the resource is publicappId
- the application ID if the resource is app-specific or nullproto
- the serialized localized resourceIOException
public abstract void removeLocalizedResource(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.fs.Path localPath) throws IOException
user
- the username or null if the resource is publicappId
- the application ID if the resource is app-specific or nulllocalPath
- local filesystem path where the resource will be storedIOException
public abstract NMStateStoreService.RecoveredDeletionServiceState loadDeletionServiceState() throws IOException
IOException
public abstract void storeDeletionTask(int taskId, org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto taskProto) throws IOException
taskId
- the deletion task IDtaskProto
- the deletion task protobufIOException
public abstract void removeDeletionTask(int taskId) throws IOException
taskId
- the deletion task IDIOException
public abstract NMStateStoreService.RecoveredNMTokensState loadNMTokensState() throws IOException
IOException
public abstract void storeNMTokenCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
key
- the master keyIOException
public abstract void storeNMTokenPreviousMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
key
- the previous master keyIOException
public abstract void storeNMTokenApplicationMasterKey(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt, org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
attempt
- the application attempt IDkey
- the master keyIOException
public abstract void removeNMTokenApplicationMasterKey(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt) throws IOException
attempt
- the application attempt IDIOException
public abstract NMStateStoreService.RecoveredContainerTokensState loadContainerTokensState() throws IOException
IOException
public abstract void storeContainerTokenCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
key
- the master keyIOException
public abstract void storeContainerTokenPreviousMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
key
- the previous master keyIOException
public abstract void storeContainerToken(org.apache.hadoop.yarn.api.records.ContainerId containerId, Long expirationTime) throws IOException
containerId
- the container IDexpirationTime
- the container token expiration timeIOException
public abstract void removeContainerToken(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container IDIOException
public abstract NMStateStoreService.RecoveredLogDeleterState loadLogDeleterState() throws IOException
IOException
public abstract void storeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.LogDeleterProto proto) throws IOException
appId
- the application ID for the log deleterproto
- the serialized state of the log deleterIOException
public abstract void removeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
appId
- the application ID for the log deleterIOException
public abstract NMStateStoreService.RecoveredAMRMProxyState loadAMRMProxyState() throws IOException
IOException
- if failspublic abstract void storeAMRMProxyCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
key
- the current master keyIOException
- if failspublic abstract void storeAMRMProxyNextMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key) throws IOException
key
- the next master keyIOException
- if failspublic abstract void storeAMRMProxyAppContextEntry(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt, String key, byte[] data) throws IOException
attempt
- app attempt IDkey
- key stringdata
- state data to storeIOException
- if failspublic abstract void removeAMRMProxyAppContextEntry(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt, String key) throws IOException
attempt
- attempt IDkey
- key stringIOException
- if failspublic abstract void removeAMRMProxyAppContext(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt) throws IOException
attempt
- attempt IDIOException
- if failspublic abstract void storeAssignedResources(Container container, String resourceType, List<Serializable> assignedResources) throws IOException
container
- NMContainerresourceType
- Resource TypeassignedResources
- Assigned resourcesIOException
- if failsprotected abstract void initStorage(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
protected abstract void startStorage() throws IOException
IOException
protected abstract void closeStorage() throws IOException
IOException
protected void updateContainerResourceMapping(Container container, String resourceType, List<Serializable> assignedResources)
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.