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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
    • Target Version/s:
    • Hadoop Flags:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: