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