org.apache.hadoop.mapreduce.v2.hs
Class HistoryServerStateStoreService

java.lang.Object
  extended by org.apache.hadoop.service.AbstractService
      extended by org.apache.hadoop.mapreduce.v2.hs.HistoryServerStateStoreService
All Implemented Interfaces:
Closeable, org.apache.hadoop.service.Service
Direct Known Subclasses:
HistoryServerFileSystemStateStoreService, HistoryServerNullStateStoreService

@InterfaceAudience.Private
@InterfaceStability.Unstable
public abstract class HistoryServerStateStoreService
extends org.apache.hadoop.service.AbstractService


Nested Class Summary
static class HistoryServerStateStoreService.HistoryServerState
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE
 
Constructor Summary
HistoryServerStateStoreService()
           
 
Method Summary
protected abstract  void closeStorage()
          Implementation-specific shutdown.
protected abstract  void initStorage(org.apache.hadoop.conf.Configuration conf)
          Implementation-specific initialization.
abstract  HistoryServerStateStoreService.HistoryServerState loadState()
          Load the history server state from the state storage.
abstract  void removeToken(org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier tokenId)
          Blocking method to remove a delegation token from the state storage.
abstract  void removeTokenMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key)
          Blocking method to remove a delegation token master key.
 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.
protected abstract  void startStorage()
          Implementation-specific startup.
abstract  void storeToken(org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier tokenId, Long renewDate)
          Blocking method to store a delegation token along with the current token sequence number to the state storage.
abstract  void storeTokenMasterKey(org.apache.hadoop.security.token.delegation.DelegationKey key)
          Blocking method to store a delegation token master key.
abstract  void updateToken(org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HistoryServerStateStoreService

public HistoryServerStateStoreService()
Method Detail

serviceInit

public void serviceInit(org.apache.hadoop.conf.Configuration conf)
                 throws IOException
Initialize the state storage

Overrides:
serviceInit in class org.apache.hadoop.service.AbstractService
Parameters:
conf - the configuration
Throws:
IOException

serviceStart

public void serviceStart()
                  throws IOException
Start the state storage for use

Overrides:
serviceStart in class org.apache.hadoop.service.AbstractService
Throws:
IOException

serviceStop

public void serviceStop()
                 throws IOException
Shutdown the state storage.

Overrides:
serviceStop in class org.apache.hadoop.service.AbstractService
Throws:
IOException

initStorage

protected abstract void initStorage(org.apache.hadoop.conf.Configuration conf)
                             throws IOException
Implementation-specific initialization.

Parameters:
conf - the configuration
Throws:
IOException

startStorage

protected abstract void startStorage()
                              throws IOException
Implementation-specific startup.

Throws:
IOException

closeStorage

protected abstract void closeStorage()
                              throws IOException
Implementation-specific shutdown.

Throws:
IOException

loadState

public abstract HistoryServerStateStoreService.HistoryServerState loadState()
                                                                     throws IOException
Load the history server state from the state storage.

Throws:
IOException

storeToken

public abstract void storeToken(org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier 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 store
renewDate - the token renewal deadline
Throws:
IOException

updateToken

public abstract void updateToken(org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier 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 update
renewDate - the new token renewal deadline
Throws:
IOException

removeToken

public abstract void removeToken(org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier 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


Copyright © 2014 Apache Software Foundation. All Rights Reserved.