Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-3569

clean up isInfoEnabled usage re logAuditEvent

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 2.0.0-alpha
    • None
    • None
    • None

    Description

      From HDFS-3535 we have

      Normally the checks are used before the method invocation if we're doing expensive things to create the args (eg lots of string concatenation) not to save the cost of the method invocation. Doesn't look like that's the case here (we're not constructing args) so we could just call logAuditEvent directly everywhere.

      There are a bunch of uses of logAuditEvent that do need to check if audit logging is enabled before constructing log messages, etc. I considered refactoring them all and concluded that it was out of scope for this change. I decided not to change the existing idiom (verbose though it is) before refactoring all users of the interface, which should be a separate change.

      There are lots of

          if (isFile && auditLog.isInfoEnabled() && isExternalInvocation()) {
            logAuditEvent(UserGroupInformation.getCurrentUser(),
          }
      

      that can easily be condensed.

      Attachments

        Activity

          People

            adi2 Andy Isaacson
            adi2 Andy Isaacson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: