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, updateContainerResourceMappingclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected void startStorage()
throws IOException
startStorage in class NMStateStoreServiceIOExceptionprotected void closeStorage()
throws IOException
closeStorage in class NMStateStoreServiceIOExceptionpublic boolean isNewlyCreated()
isNewlyCreated in class NMStateStoreServicepublic RecoveryIterator<NMStateStoreService.RecoveredContainerState> getContainerStateIterator() throws IOException
NMStateStoreServicegetContainerStateIterator in class NMStateStoreServiceIOExceptionpublic void storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int containerVersion,
long startTime,
org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest startRequest)
throws IOException
NMStateStoreServicestoreContainer in class NMStateStoreServicecontainerId - the container IDcontainerVersion - the container VersionstartTime - container start timestartRequest - the container start requestIOExceptionpublic void storeContainerQueued(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServicestoreContainerQueued in class NMStateStoreServicecontainerId - the container IDIOExceptionpublic void storeContainerPaused(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServicestoreContainerPaused in class NMStateStoreServicecontainerId - the container ID.IOException - IO Exception.public void removeContainerPaused(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServiceremoveContainerPaused in class NMStateStoreServicecontainerId - the container ID.IOException - IO Exception.public void storeContainerDiagnostics(org.apache.hadoop.yarn.api.records.ContainerId containerId,
StringBuilder diagnostics)
throws IOException
NMStateStoreServicestoreContainerDiagnostics in class NMStateStoreServicecontainerId - the container IDdiagnostics - the container diagnosticsIOExceptionpublic void storeContainerLaunched(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServicestoreContainerLaunched in class NMStateStoreServicecontainerId - the container IDIOExceptionpublic void storeContainerUpdateToken(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.security.ContainerTokenIdentifier containerTokenIdentifier)
throws IOException
NMStateStoreServicestoreContainerUpdateToken in class NMStateStoreServicecontainerId - the container IDcontainerTokenIdentifier - container token identifierIOExceptionpublic void storeContainerKilled(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServicestoreContainerKilled in class NMStateStoreServicecontainerId - the container IDIOExceptionpublic void storeContainerCompleted(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int exitCode)
throws IOException
NMStateStoreServicestoreContainerCompleted in class NMStateStoreServicecontainerId - the container IDexitCode - the exit code from the containerIOExceptionpublic void storeContainerRemainingRetryAttempts(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int remainingRetryAttempts)
throws IOException
NMStateStoreServicestoreContainerRemainingRetryAttempts in class NMStateStoreServicecontainerId - the container IDremainingRetryAttempts - the remain retry times when container
fails to runIOExceptionpublic void storeContainerRestartTimes(org.apache.hadoop.yarn.api.records.ContainerId containerId,
List<Long> restartTimes)
throws IOException
NMStateStoreServicestoreContainerRestartTimes in class NMStateStoreServiceIOExceptionpublic void storeContainerWorkDir(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String workDir)
throws IOException
NMStateStoreServicestoreContainerWorkDir in class NMStateStoreServicecontainerId - the container IDworkDir - the working directoryIOExceptionpublic void storeContainerLogDir(org.apache.hadoop.yarn.api.records.ContainerId containerId,
String logDir)
throws IOException
NMStateStoreServicestoreContainerLogDir in class NMStateStoreServicecontainerId - the container IDlogDir - the log directoryIOExceptionpublic void removeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServiceremoveContainer in class NMStateStoreServicecontainerId - the container IDIOExceptionpublic NMStateStoreService.RecoveredApplicationsState loadApplicationsState() throws IOException
NMStateStoreServiceloadApplicationsState in class NMStateStoreServiceIOException - IO Exception.public void storeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto p)
throws IOException
NMStateStoreServicestoreApplication in class NMStateStoreServiceappId - the application IDp - state to store for the applicationIOExceptionpublic void removeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
throws IOException
NMStateStoreServiceremoveApplication in class NMStateStoreServiceappId - the application IDIOExceptionpublic NMStateStoreService.RecoveredLocalizationState loadLocalizationState() throws IOException
NMStateStoreServiceloadLocalizationState in class NMStateStoreServiceIOExceptionpublic 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
NMStateStoreServicestartResourceLocalization in class NMStateStoreServiceuser - 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 storedIOExceptionpublic void finishResourceLocalization(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.LocalizedResourceProto proto) throws IOException
NMStateStoreServicefinishResourceLocalization in class NMStateStoreServiceuser - the username or null if the resource is publicappId - the application ID if the resource is app-specific or nullproto - the serialized localized resourceIOExceptionpublic void removeLocalizedResource(String user, org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.fs.Path localPath) throws IOException
NMStateStoreServiceremoveLocalizedResource in class NMStateStoreServiceuser - 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 storedIOExceptionpublic NMStateStoreService.RecoveredDeletionServiceState loadDeletionServiceState() throws IOException
NMStateStoreServiceloadDeletionServiceState in class NMStateStoreServiceIOExceptionpublic void storeDeletionTask(int taskId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto taskProto)
throws IOException
NMStateStoreServicestoreDeletionTask in class NMStateStoreServicetaskId - the deletion task IDtaskProto - the deletion task protobufIOExceptionpublic void removeDeletionTask(int taskId)
throws IOException
NMStateStoreServiceremoveDeletionTask in class NMStateStoreServicetaskId - the deletion task IDIOExceptionpublic NMStateStoreService.RecoveredNMTokensState loadNMTokensState() throws IOException
NMStateStoreServiceloadNMTokensState in class NMStateStoreServiceIOExceptionpublic void storeNMTokenCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreNMTokenCurrentMasterKey in class NMStateStoreServicekey - the master keyIOExceptionpublic void storeNMTokenPreviousMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreNMTokenPreviousMasterKey in class NMStateStoreServicekey - the previous master keyIOExceptionpublic void storeNMTokenApplicationMasterKey(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt,
org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreNMTokenApplicationMasterKey in class NMStateStoreServiceattempt - the application attempt IDkey - the master keyIOExceptionpublic void removeNMTokenApplicationMasterKey(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt)
throws IOException
NMStateStoreServiceremoveNMTokenApplicationMasterKey in class NMStateStoreServiceattempt - the application attempt IDIOExceptionpublic NMStateStoreService.RecoveredContainerTokensState loadContainerTokensState() throws IOException
NMStateStoreServiceloadContainerTokensState in class NMStateStoreServiceIOExceptionpublic void storeContainerTokenCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreContainerTokenCurrentMasterKey in class NMStateStoreServicekey - the master keyIOExceptionpublic void storeContainerTokenPreviousMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreContainerTokenPreviousMasterKey in class NMStateStoreServicekey - the previous master keyIOExceptionpublic void storeContainerToken(org.apache.hadoop.yarn.api.records.ContainerId containerId,
Long expTime)
throws IOException
NMStateStoreServicestoreContainerToken in class NMStateStoreServicecontainerId - the container IDexpTime - the container token expiration timeIOExceptionpublic void removeContainerToken(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws IOException
NMStateStoreServiceremoveContainerToken in class NMStateStoreServicecontainerId - the container IDIOExceptionpublic NMStateStoreService.RecoveredLogDeleterState loadLogDeleterState() throws IOException
NMStateStoreServiceloadLogDeleterState in class NMStateStoreServiceIOExceptionpublic void storeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.LogDeleterProto proto)
throws IOException
NMStateStoreServicestoreLogDeleter in class NMStateStoreServiceappId - the application ID for the log deleterproto - the serialized state of the log deleterIOExceptionpublic void removeLogDeleter(org.apache.hadoop.yarn.api.records.ApplicationId appId)
throws IOException
NMStateStoreServiceremoveLogDeleter in class NMStateStoreServiceappId - the application ID for the log deleterIOExceptionpublic void storeAssignedResources(Container container, String resourceType, List<Serializable> assignedResources) throws IOException
NMStateStoreServicestoreAssignedResources in class NMStateStoreServicecontainer - NMContainerresourceType - Resource TypeassignedResources - Assigned resourcesIOException - if failspublic NMStateStoreService.RecoveredAMRMProxyState loadAMRMProxyState() throws IOException
NMStateStoreServiceloadAMRMProxyState in class NMStateStoreServiceIOException - if failspublic void storeAMRMProxyCurrentMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreAMRMProxyCurrentMasterKey in class NMStateStoreServicekey - the current master keyIOException - if failspublic void storeAMRMProxyNextMasterKey(org.apache.hadoop.yarn.server.api.records.MasterKey key)
throws IOException
NMStateStoreServicestoreAMRMProxyNextMasterKey in class NMStateStoreServicekey - the next master keyIOException - if failspublic void storeAMRMProxyAppContextEntry(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt,
String key,
byte[] data)
throws IOException
NMStateStoreServicestoreAMRMProxyAppContextEntry in class NMStateStoreServiceattempt - 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
NMStateStoreServiceremoveAMRMProxyAppContextEntry in class NMStateStoreServiceattempt - attempt IDkey - key stringIOException - if failspublic void removeAMRMProxyAppContext(org.apache.hadoop.yarn.api.records.ApplicationAttemptId attempt)
throws IOException
NMStateStoreServiceremoveAMRMProxyAppContext in class NMStateStoreServiceattempt - attempt IDIOException - if failsprotected void initStorage(org.apache.hadoop.conf.Configuration conf)
throws IOException
initStorage in class NMStateStoreServiceIOExceptionprotected org.iq80.leveldb.DB openDatabase(org.apache.hadoop.conf.Configuration conf)
throws IOException
IOExceptionprotected void checkVersion()
throws IOException
IOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.