Class NoopAuditManagerS3A

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.fs.s3a.audit.impl.NoopAuditManagerS3A
All Implemented Interfaces:
Closeable, AutoCloseable, AuditManagerS3A, AWSAuditEventCallbacks, NoopSpan.SpanActivationCallbacks, org.apache.hadoop.fs.store.audit.ActiveThreadSpanSource<AuditSpanS3A>, org.apache.hadoop.fs.store.audit.AuditSpanSource<AuditSpanS3A>, org.apache.hadoop.service.Service, software.amazon.awssdk.core.interceptor.ExecutionInterceptor

@Private public class NoopAuditManagerS3A extends org.apache.hadoop.service.CompositeService implements AuditManagerS3A, NoopSpan.SpanActivationCallbacks
Simple No-op audit manager for use before a real audit chain is set up, and for testing. It does have the service lifecycle, so do create a unique instance whenever used.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService

    org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHook

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

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

    Fields inherited from class org.apache.hadoop.service.CompositeService

    STOP_ONLY_STARTED_SERVICES
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Span was activated.
    boolean
    checkAccess(org.apache.hadoop.fs.Path path, S3AFileStatus status, org.apache.hadoop.fs.permission.FsAction mode)
    Forward to the auditor.
    List<software.amazon.awssdk.core.interceptor.ExecutionInterceptor>
    Create the execution interceptor(s) for this audit service.
    createNewSpan(String name, String path1, String path2)
    A static source of no-op spans, using the same span ID source as managed spans.
    createSpan(String operation, String path1, String path2)
     
    software.amazon.awssdk.transfer.s3.progress.TransferListener
    Return a transfer callback which fixes the active span context to be that in which the transfer listener was created.
    void
    Span was deactivated.
     
    Get the auditor; valid once initialized.
    Get the name of the operation.
    Return a span ID which must be unique for all spans within everywhere.
    protected void
    serviceInit(org.apache.hadoop.conf.Configuration conf)
     
    void
    Update audit flags, especially the out of span rejection option.

    Methods inherited from class org.apache.hadoop.service.CompositeService

    addIfService, addService, getServices, removeService, serviceStart, serviceStop

    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

    Methods inherited from interface org.apache.hadoop.fs.s3a.audit.AWSAuditEventCallbacks

    requestCreated

    Methods inherited from interface software.amazon.awssdk.core.interceptor.ExecutionInterceptor

    afterExecution, afterMarshalling, afterTransmission, afterUnmarshalling, beforeExecution, beforeMarshalling, beforeTransmission, beforeUnmarshalling, modifyAsyncHttpContent, modifyAsyncHttpResponseContent, modifyException, modifyHttpContent, modifyHttpRequest, modifyHttpResponse, modifyHttpResponseContent, modifyRequest, modifyResponse, onExecutionFailure

    Methods inherited from interface org.apache.hadoop.service.Service

    close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
  • Constructor Details

    • NoopAuditManagerS3A

      public NoopAuditManagerS3A()
      Constructor. Will create and start a new instance of the auditor.
  • Method Details

    • serviceInit

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

      public String getSpanId()
      Description copied from interface: AWSAuditEventCallbacks
      Return a span ID which must be unique for all spans within everywhere. That effectively means part of the span SHOULD be derived from a UUID. Callers MUST NOT make any assumptions about the actual contents or structure of this string other than the uniqueness.
      Specified by:
      getSpanId in interface AWSAuditEventCallbacks
      Returns:
      a non-empty string
    • getOperationName

      public String getOperationName()
      Description copied from interface: AWSAuditEventCallbacks
      Get the name of the operation.
      Specified by:
      getOperationName in interface AWSAuditEventCallbacks
      Returns:
      the operation name.
    • getAuditor

      public OperationAuditor getAuditor()
      Description copied from interface: AuditManagerS3A
      Get the auditor; valid once initialized.
      Specified by:
      getAuditor in interface AuditManagerS3A
      Returns:
      the auditor.
    • getActiveAuditSpan

      public AuditSpanS3A getActiveAuditSpan()
      Specified by:
      getActiveAuditSpan in interface org.apache.hadoop.fs.store.audit.ActiveThreadSpanSource<AuditSpanS3A>
    • createSpan

      public AuditSpanS3A createSpan(String operation, @Nullable String path1, @Nullable String path2) throws IOException
      Specified by:
      createSpan in interface org.apache.hadoop.fs.store.audit.AuditSpanSource<AuditSpanS3A>
      Throws:
      IOException
    • createExecutionInterceptors

      public List<software.amazon.awssdk.core.interceptor.ExecutionInterceptor> createExecutionInterceptors() throws IOException
      Description copied from interface: AuditManagerS3A
      Create the execution interceptor(s) for this audit service. The list returned is mutable; new interceptors may be added.
      Specified by:
      createExecutionInterceptors in interface AuditManagerS3A
      Returns:
      list of interceptors for the SDK.
      Throws:
      IOException - failure.
    • createTransferListener

      public software.amazon.awssdk.transfer.s3.progress.TransferListener createTransferListener()
      Description copied from interface: AuditManagerS3A
      Return a transfer callback which fixes the active span context to be that in which the transfer listener was created. This can be used to audit the creation of the multipart upload initiation request which the transfer manager makes when a file to be copied is split up. This must be invoked/used within the active span.
      Specified by:
      createTransferListener in interface AuditManagerS3A
      Returns:
      a transfer listener.
    • checkAccess

      public boolean checkAccess(org.apache.hadoop.fs.Path path, S3AFileStatus status, org.apache.hadoop.fs.permission.FsAction mode) throws IOException
      Forward to the auditor.
      Specified by:
      checkAccess in interface AuditManagerS3A
      Parameters:
      path - path to check
      status - status of the path.
      mode - access mode.
      Returns:
      true if access is allowed.
      Throws:
      IOException - failure
    • activate

      public void activate(AuditSpanS3A span)
      Description copied from interface: NoopSpan.SpanActivationCallbacks
      Span was activated.
      Specified by:
      activate in interface NoopSpan.SpanActivationCallbacks
      Parameters:
      span - span reference.
    • deactivate

      public void deactivate(AuditSpanS3A span)
      Description copied from interface: NoopSpan.SpanActivationCallbacks
      Span was deactivated.
      Specified by:
      deactivate in interface NoopSpan.SpanActivationCallbacks
      Parameters:
      span - span reference.
    • createNewSpan

      public static AuditSpanS3A createNewSpan(String name, String path1, String path2)
      A static source of no-op spans, using the same span ID source as managed spans.
      Parameters:
      name - operation name.
      path1 - first path of operation
      path2 - second path of operation
      Returns:
      a span for the audit
    • setAuditFlags

      public void setAuditFlags(EnumSet<AuditorFlags> flags)
      Description copied from interface: AuditManagerS3A
      Update audit flags, especially the out of span rejection option.
      Specified by:
      setAuditFlags in interface AuditManagerS3A
      Parameters:
      flags - audit flags.