You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2017/12/20 20:22:29 UTC

hadoop git commit: HDFS-12863. Ozone: Avoid configuration.get() call for each container report. Contributed by Akira Ajisaka.

Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7240 8e44ce938 -> d3acb451a


HDFS-12863. Ozone: Avoid configuration.get() call for each container report. Contributed by Akira Ajisaka.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d3acb451
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d3acb451
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d3acb451

Branch: refs/heads/HDFS-7240
Commit: d3acb451a0c9e89cc44985233066c35d291ec4e8
Parents: 8e44ce9
Author: Anu Engineer <ae...@apache.org>
Authored: Wed Dec 20 11:18:37 2017 -0800
Committer: Anu Engineer <ae...@apache.org>
Committed: Wed Dec 20 11:18:37 2017 -0800

----------------------------------------------------------------------
 .../container/common/impl/ContainerReportManagerImpl.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d3acb451/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerReportManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerReportManagerImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerReportManagerImpl.java
index bd6e7ba..4669737 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerReportManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerReportManagerImpl.java
@@ -33,10 +33,10 @@ import java.util.concurrent.atomic.AtomicLong;
  * // TODO: support incremental/delta container report
  */
 public class ContainerReportManagerImpl implements ContainerReportManager {
-  private Configuration config;
   // Last non-empty container report time
   private long lastContainerReportTime;
   private final long containerReportInterval;
+  private final long heartbeatInterval;
   private AtomicLong reportCount;
   private static final ReportState NO_CONTAINER_REPORTSTATE =
       ReportState.newBuilder()
@@ -44,13 +44,13 @@ public class ContainerReportManagerImpl implements ContainerReportManager {
           .setCount(0).build();
 
   public ContainerReportManagerImpl(Configuration config) {
-    this.config = config;
     this.lastContainerReportTime = -1;
     this.reportCount = new AtomicLong(0L);
     this.containerReportInterval = config.getTimeDuration(
         OzoneConfigKeys.OZONE_CONTAINER_REPORT_INTERVAL,
         OzoneConfigKeys.OZONE_CONTAINER_REPORT_INTERVAL_DEFAULT,
         TimeUnit.MILLISECONDS);
+    this.heartbeatInterval = OzoneClientUtils.getScmHeartbeatInterval(config);
   }
 
   public ReportState getContainerReportState() {
@@ -82,7 +82,6 @@ public class ContainerReportManagerImpl implements ContainerReportManager {
   }
 
   private long getRandomReportDelay() {
-    return RandomUtils.nextLong(0,
-        OzoneClientUtils.getScmHeartbeatInterval(config));
+    return RandomUtils.nextLong(0, heartbeatInterval);
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org