Class AbstractDTService

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.fs.s3a.auth.delegation.AbstractDTService
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service
Direct Known Subclasses:
AbstractDelegationTokenBinding, S3ADelegationTokens

public abstract class AbstractDTService extends org.apache.hadoop.service.AbstractService
This is the base class for both the delegation binding code and the back end service created; allows for shared methods across both. The lifecycle sequence is as follows
   - create
   - bindToFileSystem(uri, ownerFS)
   - init
   - start
   ...api calls...
   - stop
 
As the S3ADelegation mechanism is all configured during the filesystem initalize() operation, it is not ready for use through all the start process.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

    org.apache.hadoop.service.Service.STATE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Protected constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bindToFileSystem(URI uri, StoreContext context, DelegationOperations delegationOperations)
    Bind to the filesystem.
    Get the canonical URI of the filesystem, which is what is used to identify the tokens.
    org.apache.hadoop.security.UserGroupInformation
    Get the owner of this Service.
     
    protected StoreContext
     
    protected void
    Require the service to be started.
    protected void
    requireServiceState(org.apache.hadoop.service.Service.STATE state)
    Require that the service is in a given state.
    protected void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
     

    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, serviceStart, serviceStop, 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 Details

    • AbstractDTService

      protected AbstractDTService(String name)
      Protected constructor.
      Parameters:
      name - service name.
  • Method Details

    • bindToFileSystem

      public void bindToFileSystem(URI uri, StoreContext context, DelegationOperations delegationOperations) throws IOException
      Bind to the filesystem. Subclasses can use this to perform their own binding operations - but they must always call their superclass implementation. This Must be called before calling init(). Important: This binding will happen during FileSystem.initialize(); the FS is not live for actual use and will not yet have interacted with AWS services.
      Parameters:
      uri - the canonical URI of the FS.
      context - store context
      delegationOperations - delegation operations
      Throws:
      IOException - failure.
    • getCanonicalUri

      public URI getCanonicalUri()
      Get the canonical URI of the filesystem, which is what is used to identify the tokens.
      Returns:
      the URI.
    • getOwner

      public org.apache.hadoop.security.UserGroupInformation getOwner()
      Get the owner of this Service.
      Returns:
      owner; non-null after binding to an FS.
    • getStoreContext

      protected StoreContext getStoreContext()
    • getPolicyProvider

      protected DelegationOperations getPolicyProvider()
    • requireServiceState

      protected void requireServiceState(org.apache.hadoop.service.Service.STATE state) throws IllegalStateException
      Require that the service is in a given state.
      Parameters:
      state - desired state.
      Throws:
      IllegalStateException - if the condition is not met
    • requireServiceStarted

      protected void requireServiceStarted() throws IllegalStateException
      Require the service to be started.
      Throws:
      IllegalStateException - if it is not.
    • serviceInit

      protected void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
      Overrides:
      serviceInit in class org.apache.hadoop.service.AbstractService
      Throws:
      Exception