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

Log refactoring: method invocation should be replaced by a shorter method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.7.2
    • None
    • None

    Description

      Similar to the fix for AVRO-115. In file:

      hadoop-rel-release-2.7.2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

      in line 695, the logging code:

      LOG.info(getRole() + " RPC up at: " + rpcServer.getRpcAddress());
      

      In the same class, there is a method in line 907:

        /**
         * @return NameNode RPC address
         */
        public InetSocketAddress getNameNodeAddress() {
          return rpcServer.getRpcAddress();
        }
      

      We can tell that rpcServer.getRpcAddress() could be replaced by method getNameNodeAddress() for the case of readability and simplicity

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chenfsd Nemo Chen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: