org.apache.hadoop.hdfs.server.namenode

## Class HdfsAuditLogger

- java.lang.Object
- - org.apache.hadoop.hdfs.server.namenode.HdfsAuditLogger

- All Implemented Interfaces:
    AuditLogger

      @InterfaceAudience.Public
       @InterfaceStability.Evolving
      public abstract class HdfsAuditLogger
      extends Object
      implements AuditLogger

  Extension of `AuditLogger`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HdfsAuditLogger()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `logAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, org.apache.hadoop.fs.FileStatus status)` Called to log an audit event.
    `abstract void` | `logAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, org.apache.hadoop.fs.FileStatus stat, org.apache.hadoop.ipc.CallerContext callerContext, org.apache.hadoop.security.UserGroupInformation ugi, org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager)` Same as `logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus)` with additional parameters related to logging delegation token tracking IDs.
    `abstract void` | `logAuditEvent(boolean succeeded, String userName, InetAddress addr, String cmd, String src, String dst, org.apache.hadoop.fs.FileStatus stat, org.apache.hadoop.security.UserGroupInformation ugi, org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager)` Same as `logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus, CallerContext, UserGroupInformation, DelegationTokenSecretManager)` without `CallerContext` information.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.hadoop.hdfs.server.namenode.AuditLogger

      `initialize`

- - ### Constructor Detail

    - #### HdfsAuditLogger

          public HdfsAuditLogger()

  - ### Method Detail

    - #### logAuditEvent

          public void logAuditEvent(boolean succeeded,
                                    String userName,
                                    InetAddress addr,
                                    String cmd,
                                    String src,
                                    String dst,
                                    org.apache.hadoop.fs.FileStatus status)

      Description copied from interface: `AuditLogger`
      Called to log an audit event.

      This method must return as quickly as possible, since it's called in a critical section of the NameNode's operation.

      Specified by:
        `logAuditEvent` in interface `AuditLogger`
      Parameters:
        `succeeded` - Whether authorization succeeded.
        `userName` - Name of the user executing the request.
        `addr` - Remote address of the request.
        `cmd` - The requested command.
        `src` - Path of affected source file.
        `dst` - Path of affected destination file (if any).
        `status` - File information for operations that change the file's metadata (permissions, owner, times, etc).

    - #### logAuditEvent

          public abstract void logAuditEvent(boolean succeeded,
                                             String userName,
                                             InetAddress addr,
                                             String cmd,
                                             String src,
                                             String dst,
                                             org.apache.hadoop.fs.FileStatus stat,
                                             org.apache.hadoop.ipc.CallerContext callerContext,
                                             org.apache.hadoop.security.UserGroupInformation ugi,
                                             org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager)

      Same as `logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus)` with additional parameters related to logging delegation token tracking IDs.
      Parameters:
        `succeeded` - Whether authorization succeeded.
        `userName` - Name of the user executing the request.
        `addr` - Remote address of the request.
        `cmd` - The requested command.
        `src` - Path of affected source file.
        `dst` - Path of affected destination file (if any).
        `stat` - File information for operations that change the file's metadata (permissions, owner, times, etc).
        `callerContext` - Context information of the caller
        `ugi` - UserGroupInformation of the current user, or null if not logging token tracking information
        `dtSecretManager` - The token secret manager, or null if not logging token tracking information

    - #### logAuditEvent

          public abstract void logAuditEvent(boolean succeeded,
                                             String userName,
                                             InetAddress addr,
                                             String cmd,
                                             String src,
                                             String dst,
                                             org.apache.hadoop.fs.FileStatus stat,
                                             org.apache.hadoop.security.UserGroupInformation ugi,
                                             org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenSecretManager dtSecretManager)

      Same as `logAuditEvent(boolean, String, InetAddress, String, String, String, FileStatus, CallerContext, UserGroupInformation, DelegationTokenSecretManager)` without `CallerContext` information.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.