Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16805

Utilities isEmptyPath Logging Too Chatty and Uses Bad Format

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.1, 3.0.0
    • 3.0.0
    • Query Processor
    • None
    • Patch

    Description

      org.apache.hadoop.hive.ql.exec.Utilities
        public static boolean isEmptyPath(JobConf job, Path dirPath, Context ctx)
            throws Exception {
          if (ctx != null) {
            ContentSummary cs = ctx.getCS(dirPath);
            if (cs != null) {
              LOG.info("Content Summary " + dirPath + "length: " + cs.getLength() + " num files: "
                  + cs.getFileCount() + " num directories: " + cs.getDirectoryCount());
              return (cs.getLength() == 0 && cs.getFileCount() == 0 && cs.getDirectoryCount() <= 1);
            } else {
              LOG.info("Content Summary not cached for " + dirPath);
            }
          }
          return isEmptyPath(job, dirPath);
        }
      
      1. This is too chatty. Logging for caching is not necessary for INFO logging. Move to DEBUG
      2. Use Log4J's {} format
      3. Make the messages more symmetrical - The success message doesn't include the word "cache" in it at all
      4. Missing a space between the path and "length: " so the path is concatenated with the string "length:"

      Attachments

        1. HIVE-16805.3.patch
          1 kB
          David Mollitor
        2. HIVE-16805.2.patch
          1 kB
          David Mollitor
        3. HIVE-16805.1.patch
          1 kB
          David Mollitor

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: