public class NMLeveldbStateStoreService extends NMStateStoreService
NMStateStoreService.LocalResourceTrackerState, NMStateStoreService.RecoveredApplicationsState, NMStateStoreService.RecoveredContainerState, NMStateStoreService.RecoveredContainerStatus, NMStateStoreService.RecoveredContainerTokensState, NMStateStoreService.RecoveredDeletionServiceState, NMStateStoreService.RecoveredLocalizationState, NMStateStoreService.RecoveredLogDeleterState, NMStateStoreService.RecoveredNMTokensState, NMStateStoreService.RecoveredUserResources
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
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
|
protected void |
initStorage(org.apache.hadoop.conf.Configuration conf) |
boolean |
isNewlyCreated() |
NMStateStoreService.RecoveredApplicationsState |
loadApplicationsState()
Load the state of applications
|
List<NMStateStoreService.RecoveredContainerState> |
loadContainersState()
Load the state of containers
|
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 |
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 |
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 |
storeApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.ContainerManagerApplicationProto p)
Record the start of an application
|
void |
storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int containerVersion,
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 |
storeContainerResourceChanged(org.apache.hadoop.yarn.api.records.ContainerId containerId,
int containerVersion,
org.apache.hadoop.yarn.api.records.Resource capability)
Record that a container resource has been changed
|
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 |
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, serviceInit, serviceStart, serviceStop
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 List<NMStateStoreService.RecoveredContainerState> loadContainersState() throws IOException
NMStateStoreService
loadContainersState
in class NMStateStoreService
IOException
public void storeContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId, int containerVersion, org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest startRequest) throws IOException
NMStateStoreService
storeContainer
in class NMStateStoreService
containerId
- the container IDcontainerVersion
- the container VersionstartRequest
- the container start requestIOException
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 storeContainerResourceChanged(org.apache.hadoop.yarn.api.records.ContainerId containerId, int containerVersion, org.apache.hadoop.yarn.api.records.Resource capability) throws IOException
NMStateStoreService
storeContainerResourceChanged
in class NMStateStoreService
containerId
- the container IDcontainerVersion
- the container versioncapability
- the container resource capabilityIOException
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 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
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
protected 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 © 2017 Apache Software Foundation. All Rights Reserved.