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

Time.NANOSECONDS_PER_MILLISECOND - use class-level final constant instead of method variable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • None
    • Reviewed

    Description

      NANOSECONDS_PER_MILLISECOND constant can be moved to class level instead of creating it in each method call.

      org.apache.hadoop.util.Time.java
       public static long monotonicNow() {
          final long NANOSECONDS_PER_MILLISECOND = 1000000;
      
          return System.nanoTime() / NANOSECONDS_PER_MILLISECOND;
        }
      

      Attachments

        1. 001-HDFS-7919.patch
          1.0 kB
          Ajith S

        Activity

          People

            ajithshetty Ajith S
            ajithshetty Ajith S
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: