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

Normalize the usage of debug logs in NameNode

    XMLWordPrintableJSON

Details

    Description

      There are many irregular debug logs in NameNode. such as:
      Error type1:

      if (LOG.isDebugEnabled()) {
            LOG.debug("Getting groups for user " + user);
      }
      

      we can format it to:

      LOG.debug("Getting groups for user {}. ", user);
      

      Error type2:

      LOG.debug("*DIR* NameNode.renameSnapshot: Snapshot Path {}, " +
              "snapshotOldName {}, snapshotNewName {}", snapshotRoot,
              snapshotOldName, snapshotNewName);
      

      we can format it to:

      if (LOG.isDebugEnabled()) {
        LOG.debug("*DIR* NameNode.renameSnapshot: Snapshot Path {}, " +
              "snapshotOldName {}, snapshotNewName {}", snapshotRoot,
              snapshotOldName, snapshotNewName); 
      }
      

      Error type3:

      if (LOG.isDebugEnabled()) {
            LOG.debug("getAdditionalDatanode: src=" + src
                + ", fileId=" + fileId
                + ", blk=" + blk
                + ", existings=" + Arrays.asList(existings)
                + ", excludes=" + Arrays.asList(excludes)
                + ", numAdditionalNodes=" + numAdditionalNodes
                + ", clientName=" + clientName);
          }
      

      We can format it to:

       if (LOG.isDebugEnabled()) {
         LOG.debug("getAdditionalDatanode: src={}, fileId={}, "
                 + "blk={}, existings={}, excludes={}, numAdditionalNodes={}, "
                + "clientName={}.", src, fileId, blk, Arrays.asList(existings),
                Arrays.asList(excludes), numAdditionalNodes, clientName);
       }
      

      Attachments

        Issue Links

          Activity

            People

              xuzq_zander ZanderXu
              xuzq_zander ZanderXu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 6h 50m
                  6h 50m