Class TimelineStateStore
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.timeline.recovery.TimelineStateStore
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
- Direct Known Subclasses:
LeveldbTimelineStateStore,MemoryTimelineStateStore
@Private
@Unstable
public abstract class TimelineStateStore
extends org.apache.hadoop.service.AbstractService
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidImplementation-specific shutdown.protected abstract voidinitStorage(org.apache.hadoop.conf.Configuration conf) Implementation-specific initialization.Load the timeline service state from the state storage.abstract voidremoveToken(org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier tokenId) Blocking method to remove a delegation token from the state storage.abstract voidremoveTokenMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key) Blocking method to remove a delegation token master key.voidserviceInit(org.apache.hadoop.conf.Configuration conf) Initialize the state storagevoidStart the state storage for usevoidShutdown the state storage.protected abstract voidImplementation-specific startup.abstract voidstoreToken(org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier tokenId, Long renewDate) Blocking method to store a delegation token along with the current token sequence number to the state storage.abstract voidstoreTokenMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key) Blocking method to store a delegation token master key.abstract voidupdateToken(org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier tokenId, Long renewDate) Blocking method to update the expiration of a delegation token in the state storage.Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
TimelineStateStore
public TimelineStateStore() -
TimelineStateStore
-
-
Method Details
-
serviceInit
Initialize the state storage- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Parameters:
conf- the configuration- Throws:
IOException
-
serviceStart
Start the state storage for use- Overrides:
serviceStartin classorg.apache.hadoop.service.AbstractService- Throws:
IOException
-
serviceStop
Shutdown the state storage.- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
IOException
-
initStorage
Implementation-specific initialization.- Parameters:
conf- the configuration- Throws:
IOException
-
startStorage
Implementation-specific startup.- Throws:
IOException
-
closeStorage
Implementation-specific shutdown.- Throws:
IOException
-
loadState
Load the timeline service state from the state storage.- Throws:
IOException
-
storeToken
public abstract void storeToken(org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier tokenId, Long renewDate) throws IOException Blocking method to store a delegation token along with the current token sequence number to the state storage. Implementations must not return from this method until the token has been committed to the state store.- Parameters:
tokenId- the token to storerenewDate- the token renewal deadline- Throws:
IOException
-
updateToken
public abstract void updateToken(org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier tokenId, Long renewDate) throws IOException Blocking method to update the expiration of a delegation token in the state storage. Implementations must not return from this method until the expiration date of the token has been updated in the state store.- Parameters:
tokenId- the token to updaterenewDate- the new token renewal deadline- Throws:
IOException
-
removeToken
public abstract void removeToken(org.apache.hadoop.yarn.security.client.TimelineDelegationTokenIdentifier tokenId) throws IOException Blocking method to remove a delegation token from the state storage. Implementations must not return from this method until the token has been removed from the state store.- Parameters:
tokenId- the token to remove- Throws:
IOException
-
storeTokenMasterKey
public abstract void storeTokenMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key) throws IOException Blocking method to store a delegation token master key. Implementations must not return from this method until the key has been committed to the state store.- Parameters:
key- the master key to store- Throws:
IOException
-
removeTokenMasterKey
public abstract void removeTokenMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key) throws IOException Blocking method to remove a delegation token master key. Implementations must not return from this method until the key has been removed from the state store.- Parameters:
key- the master key to remove- Throws:
IOException
-