Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16EA817E37 for ; Fri, 20 Mar 2015 15:55:23 +0000 (UTC) Received: (qmail 11206 invoked by uid 500); 20 Mar 2015 15:55:16 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 11133 invoked by uid 500); 20 Mar 2015 15:55:16 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 11124 invoked by uid 99); 20 Mar 2015 15:55:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Mar 2015 15:55:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5CD56E10AC; Fri, 20 Mar 2015 15:55:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ozawa@apache.org To: common-commits@hadoop.apache.org Message-Id: <06dec5498dc2497d858c81356e82fb74@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HADOOP-11709. Time.NANOSECONDS_PER_MILLISECOND - use class-level final constant instead of method variable. Contributed by Ajith S. Date: Fri, 20 Mar 2015 15:55:16 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/trunk 8041267f0 -> 43dde502b HADOOP-11709. Time.NANOSECONDS_PER_MILLISECOND - use class-level final constant instead of method variable. Contributed by Ajith S. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/43dde502 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/43dde502 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/43dde502 Branch: refs/heads/trunk Commit: 43dde502b3be2133d62f1f074f016f35a56a7e2c Parents: 8041267 Author: Tsuyoshi Ozawa Authored: Sat Mar 21 00:54:20 2015 +0900 Committer: Tsuyoshi Ozawa Committed: Sat Mar 21 00:54:20 2015 +0900 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/util/Time.java | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/43dde502/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c4aeec1..823a36b 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -452,6 +452,9 @@ Release 2.8.0 - UNRELEASED HADOOP-11659. o.a.h.fs.FileSystem.Cache#remove should use a single hash map lookup. (Brahma Reddy Battula via aajisaka) + HADOOP-11709. Time.NANOSECONDS_PER_MILLISECOND - use class-level final + constant instead of method variable (Ajith S via ozawa) + OPTIMIZATIONS BUG FIXES http://git-wip-us.apache.org/repos/asf/hadoop/blob/43dde502/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java index 347cdc5..b988923 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Time.java @@ -28,6 +28,11 @@ import org.apache.hadoop.classification.InterfaceStability; public final class Time { /** + * number of nano seconds in 1 millisecond + */ + private static final long NANOSECONDS_PER_MILLISECOND = 1000000; + + /** * Current system time. Do not use this to calculate a duration or interval * to sleep, because it will be broken by settimeofday. Instead, use * monotonicNow. @@ -45,8 +50,6 @@ public final class Time { * @return a monotonic clock that counts in milliseconds. */ public static long monotonicNow() { - final long NANOSECONDS_PER_MILLISECOND = 1000000; - return System.nanoTime() / NANOSECONDS_PER_MILLISECOND; } }