@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.RecoveredApplicationsState |
static class |
NMStateStoreService.RecoveredContainerState |
static class |
NMStateStoreService.RecoveredContainerStatus |
static class |
NMStateStoreService.RecoveredContainerTokensState |
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,
YarnServerNodemanagerRecoveryProtos.LocalizedResourceProto proto)
Record the completion of a resource localization
|
protected abstract void |
initStorage(org.apache.hadoop.conf.Configuration conf) |
boolean |
isNewlyCreated() |
abstract NMStateStoreService.RecoveredApplicationsState |
loadApplicationsState()
Load the state of applications
|
abstract List<NMStateStoreService.RecoveredContainerState> |
loadContainersState()
Load the state of containers
|
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 |
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 |
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.
|
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 |
storeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto p)
Record the start of an application
|
abstract void |
storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
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 |
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 |
storeDeletionTask(int taskId,
YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto taskProto)
Record a deletion task
|
abstract void |
storeFinishedApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Record that an application has finished
|
abstract void |
storeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId,
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
|
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)
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
public abstract void storeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId, YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto p) throws IOException
appId
- the application IDp
- state to store for the applicationIOException
public abstract void storeFinishedApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
appId
- the application IDIOException
public abstract void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId) throws IOException
appId
- the application IDIOException
public abstract List<NMStateStoreService.RecoveredContainerState> loadContainersState() throws IOException
IOException
public abstract void storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest startRequest) throws IOException
containerId
- the container IDstartRequest
- the container start requestIOException
public abstract void storeContainerLaunched(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws IOException
containerId
- the container IDIOException
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 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, 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, 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, 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
protected 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
Copyright © 2017 Apache Software Foundation. All Rights Reserved.