Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-16717

Remove GenericsUtil isLog4jLogger dependency on Log4jLoggerAdapter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Remove this method:

        /**
         * Determine whether the log of <code>clazz</code> is Log4j implementation.
         * @param clazz a class to be determined
         * @return true if the log of <code>clazz</code> is Log4j implementation.
         */
        public static boolean isLog4jLogger(Class<?> clazz) {
          if (clazz == null) {
            return false;
          }
          Logger log = LoggerFactory.getLogger(clazz);
          return log instanceof Log4jLoggerAdapter;
        }
      

      This creates a dependency on Log4jLoggerAdapter (slf4j-log4j12) which means that any project which depends on hadoop-commons needs to carry this dependency as well. Such a simple use case and such a heavy dependency. The commons library should not depend on any specific implementation of SLF4J binding

        Attachments

        1. HADOOP-16717.001.patch
          2 kB
          Xieming Li
        2. HADOOP-16717.002.patch
          1 kB
          Xieming Li
        3. HADOOP-16717.003.patch
          1 kB
          Xieming Li

          Issue Links

            Activity

              People

              • Assignee:
                risyomei Xieming Li
                Reporter:
                belugabehr David Mollitor
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: