Class AuditIntegration

java.lang.Object
org.apache.hadoop.fs.s3a.audit.AuditIntegration

public final class AuditIntegration extends Object
Support for integrating auditing within the S3A code.
  • Method Details

    • createAndStartAuditManager

      public static AuditManagerS3A createAndStartAuditManager(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.statistics.impl.IOStatisticsStore iostatistics)
      Create and start an audit manager.
      Parameters:
      conf - configuration
      iostatistics - IOStatistics source.
      Returns:
      audit manager.
    • stubAuditManager

      public static AuditManagerS3A stubAuditManager()
      Return a stub audit manager.
      Returns:
      an audit manager.
    • createAndInitAuditor

      public static OperationAuditor createAndInitAuditor(org.apache.hadoop.conf.Configuration conf, String key, OperationAuditorOptions options) throws IOException
      Create and initialize an audit service. The service start operation is not called: that is left to the caller.
      Parameters:
      conf - configuration to read the key from and to use to init the service.
      key - key containing the classname
      options - options to initialize with.
      Returns:
      instantiated class.
      Throws:
      IOException - failure to initialise.
    • retrieveAttachedSpan

      public static AuditSpanS3A retrieveAttachedSpan(software.amazon.awssdk.core.interceptor.ExecutionAttributes executionAttributes)
      Get the span from the execution attributes.
      Parameters:
      executionAttributes - the execution attributes
      Returns:
      the span callbacks or null
    • attachSpanToRequest

      public static void attachSpanToRequest(software.amazon.awssdk.core.interceptor.ExecutionAttributes executionAttributes, AuditSpanS3A span)
      Attach a span to the execution attributes.
      Parameters:
      executionAttributes - the execution attributes
      span - span to attach
    • translateAuditException

      public static IOException translateAuditException(String path, AuditFailureException exception)
      Translate an audit exception.
      Parameters:
      path - path of operation.
      exception - exception
      Returns:
      the IOE to raise.
    • maybeTranslateAuditException

      public static IOException maybeTranslateAuditException(String path, Exception exception)
      Translate an exception if it or its inner exception is an AuditFailureException. If this condition is not met, null is returned.
      Parameters:
      path - path of operation.
      exception - exception
      Returns:
      a translated exception or null.
    • containsAuditException

      public static boolean containsAuditException(Exception exception)
    • isRejectOutOfSpan

      public static boolean isRejectOutOfSpan(org.apache.hadoop.conf.Configuration conf)
      Check if the configuration is set to reject operations that are performed outside of an audit span.
      Parameters:
      conf - the configuration to check
      Returns:
      true if operations outside of an audit span should be rejected, false otherwise