Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-6200 Create a separate jar for hdfs-client
  3. HDFS-8971

Remove guards when calling LOG.debug() and LOG.trace() in client package

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • build
    • None
    • Reviewed

    Description

      We moved the shortcircuit package from hadoop-hdfs to hadoop-hdfs-client module in JIRA HDFS-8934 and HDFS-8951, and BlockReader in HDFS-8925. Meanwhile, we also replaced the log4j log with slf4j logger. There were existing code in the client package to guard the log when calling LOG.debug() and LOG.trace(), e.g. in ShortCircuitCache.java, we have code like this:

      Trace with guards
      724    if (LOG.isTraceEnabled()) {
      725      LOG.trace(this + ": found waitable for " + key);
      726    }
      

      In slf4j, this kind of guard is not necessary. We should clean the code by removing the guard from the client package.

      Trace without guards
      724    LOG.trace("{}: found waitable for {}", this, key);
      

      Attachments

        1. HDFS-8971.000.patch
          82 kB
          Mingliang Liu
        2. HDFS-8971.001.patch
          82 kB
          Mingliang Liu

        Issue Links

          Activity

            People

              liuml07 Mingliang Liu
              liuml07 Mingliang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: