From fcabc8f0e4097cce934308fdd28cd3bcdbb66877 Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Mon, 4 Mar 2019 15:16:29 -0800 Subject: [PATCH] HDFS-14335. RBF: Fix heartbeat typos in the Router. Contributed by CR Hota. --- .../hdfs/server/federation/router/Router.java | 18 +++++++++--------- .../router/TestRouterClientRejectOverload.java | 2 +- .../router/TestRouterNamenodeMonitoring.java | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java index 0257162d13..7d112f90de 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java @@ -208,9 +208,9 @@ protected void serviceInit(Configuration configuration) throws Exception { // Create status updater for each monitored Namenode this.namenodeHeartbeatServices = createNamenodeHeartbeatServices(); - for (NamenodeHeartbeatService hearbeatService : + for (NamenodeHeartbeatService heartbeatService : this.namenodeHeartbeatServices) { - addService(hearbeatService); + addService(heartbeatService); } if (this.namenodeHeartbeatServices.isEmpty()) { @@ -487,9 +487,9 @@ public InetSocketAddress getHttpServerAddress() { if (conf.getBoolean( RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE, RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE_DEFAULT)) { - // Create a local heartbet service + // Create a local heartbeat service NamenodeHeartbeatService localHeartbeatService = - createLocalNamenodeHearbeatService(); + createLocalNamenodeHeartbeatService(); if (localHeartbeatService != null) { String nnDesc = localHeartbeatService.getNamenodeDesc(); ret.put(nnDesc, localHeartbeatService); @@ -514,7 +514,7 @@ public InetSocketAddress getHttpServerAddress() { } if (nsId != null) { NamenodeHeartbeatService heartbeatService = - createNamenodeHearbeatService(nsId, nnId); + createNamenodeHeartbeatService(nsId, nnId); if (heartbeatService != null) { ret.put(heartbeatService.getNamenodeDesc(), heartbeatService); } @@ -530,7 +530,7 @@ public InetSocketAddress getHttpServerAddress() { * * @return Updater of the status for the local Namenode. */ - protected NamenodeHeartbeatService createLocalNamenodeHearbeatService() { + protected NamenodeHeartbeatService createLocalNamenodeHeartbeatService() { // Detect NN running in this machine String nsId = DFSUtil.getNamenodeNameServiceId(conf); String nnId = null; @@ -541,7 +541,7 @@ protected NamenodeHeartbeatService createLocalNamenodeHearbeatService() { } } - return createNamenodeHearbeatService(nsId, nnId); + return createNamenodeHeartbeatService(nsId, nnId); } /** @@ -551,7 +551,7 @@ protected NamenodeHeartbeatService createLocalNamenodeHearbeatService() { * @param nnId Identifier of the namenode (HA) to monitor. * @return Updater of the status for the specified Namenode. */ - protected NamenodeHeartbeatService createNamenodeHearbeatService( + protected NamenodeHeartbeatService createNamenodeHeartbeatService( String nsId, String nnId) { LOG.info("Creating heartbeat service for Namenode {} in {}", nnId, nsId); @@ -739,7 +739,7 @@ RouterQuotaUpdateService getQuotaCacheUpdateService() { * Get the list of namenode heartbeat service. */ @VisibleForTesting - Collection getNamenodeHearbeatServices() { + Collection getNamenodeHeartbeatServices() { return this.namenodeHeartbeatServices; } diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterClientRejectOverload.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterClientRejectOverload.java index 14bd7b0a40..a4611f22e8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterClientRejectOverload.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterClientRejectOverload.java @@ -341,7 +341,7 @@ public void testNoNamenodesAvailable() throws Exception{ for (RouterContext routerContext : cluster.getRouters()) { // Manually trigger the heartbeat Collection heartbeatServices = routerContext - .getRouter().getNamenodeHearbeatServices(); + .getRouter().getNamenodeHeartbeatServices(); for (NamenodeHeartbeatService service : heartbeatServices) { service.periodicInvoke(); } diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterNamenodeMonitoring.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterNamenodeMonitoring.java index 75c267643f..0bea11c017 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterNamenodeMonitoring.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterNamenodeMonitoring.java @@ -113,7 +113,7 @@ public void testNamenodeMonitoring() throws Exception { } Collection heartbeatServices = routerContext - .getRouter().getNamenodeHearbeatServices(); + .getRouter().getNamenodeHeartbeatServices(); // manually trigger the heartbeat for (NamenodeHeartbeatService service : heartbeatServices) { service.periodicInvoke();