HDFS-14335. RBF: Fix heartbeat typos in the Router. Contributed by CR Hota.
This commit is contained in:
parent
6cdf8db55c
commit
fcabc8f0e4
@ -208,9 +208,9 @@ protected void serviceInit(Configuration configuration) throws Exception {
|
|||||||
|
|
||||||
// Create status updater for each monitored Namenode
|
// Create status updater for each monitored Namenode
|
||||||
this.namenodeHeartbeatServices = createNamenodeHeartbeatServices();
|
this.namenodeHeartbeatServices = createNamenodeHeartbeatServices();
|
||||||
for (NamenodeHeartbeatService hearbeatService :
|
for (NamenodeHeartbeatService heartbeatService :
|
||||||
this.namenodeHeartbeatServices) {
|
this.namenodeHeartbeatServices) {
|
||||||
addService(hearbeatService);
|
addService(heartbeatService);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.namenodeHeartbeatServices.isEmpty()) {
|
if (this.namenodeHeartbeatServices.isEmpty()) {
|
||||||
@ -487,9 +487,9 @@ public InetSocketAddress getHttpServerAddress() {
|
|||||||
if (conf.getBoolean(
|
if (conf.getBoolean(
|
||||||
RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE,
|
RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE,
|
||||||
RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE_DEFAULT)) {
|
RBFConfigKeys.DFS_ROUTER_MONITOR_LOCAL_NAMENODE_DEFAULT)) {
|
||||||
// Create a local heartbet service
|
// Create a local heartbeat service
|
||||||
NamenodeHeartbeatService localHeartbeatService =
|
NamenodeHeartbeatService localHeartbeatService =
|
||||||
createLocalNamenodeHearbeatService();
|
createLocalNamenodeHeartbeatService();
|
||||||
if (localHeartbeatService != null) {
|
if (localHeartbeatService != null) {
|
||||||
String nnDesc = localHeartbeatService.getNamenodeDesc();
|
String nnDesc = localHeartbeatService.getNamenodeDesc();
|
||||||
ret.put(nnDesc, localHeartbeatService);
|
ret.put(nnDesc, localHeartbeatService);
|
||||||
@ -514,7 +514,7 @@ public InetSocketAddress getHttpServerAddress() {
|
|||||||
}
|
}
|
||||||
if (nsId != null) {
|
if (nsId != null) {
|
||||||
NamenodeHeartbeatService heartbeatService =
|
NamenodeHeartbeatService heartbeatService =
|
||||||
createNamenodeHearbeatService(nsId, nnId);
|
createNamenodeHeartbeatService(nsId, nnId);
|
||||||
if (heartbeatService != null) {
|
if (heartbeatService != null) {
|
||||||
ret.put(heartbeatService.getNamenodeDesc(), heartbeatService);
|
ret.put(heartbeatService.getNamenodeDesc(), heartbeatService);
|
||||||
}
|
}
|
||||||
@ -530,7 +530,7 @@ public InetSocketAddress getHttpServerAddress() {
|
|||||||
*
|
*
|
||||||
* @return Updater of the status for the local Namenode.
|
* @return Updater of the status for the local Namenode.
|
||||||
*/
|
*/
|
||||||
protected NamenodeHeartbeatService createLocalNamenodeHearbeatService() {
|
protected NamenodeHeartbeatService createLocalNamenodeHeartbeatService() {
|
||||||
// Detect NN running in this machine
|
// Detect NN running in this machine
|
||||||
String nsId = DFSUtil.getNamenodeNameServiceId(conf);
|
String nsId = DFSUtil.getNamenodeNameServiceId(conf);
|
||||||
String nnId = null;
|
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.
|
* @param nnId Identifier of the namenode (HA) to monitor.
|
||||||
* @return Updater of the status for the specified Namenode.
|
* @return Updater of the status for the specified Namenode.
|
||||||
*/
|
*/
|
||||||
protected NamenodeHeartbeatService createNamenodeHearbeatService(
|
protected NamenodeHeartbeatService createNamenodeHeartbeatService(
|
||||||
String nsId, String nnId) {
|
String nsId, String nnId) {
|
||||||
|
|
||||||
LOG.info("Creating heartbeat service for Namenode {} in {}", nnId, nsId);
|
LOG.info("Creating heartbeat service for Namenode {} in {}", nnId, nsId);
|
||||||
@ -739,7 +739,7 @@ RouterQuotaUpdateService getQuotaCacheUpdateService() {
|
|||||||
* Get the list of namenode heartbeat service.
|
* Get the list of namenode heartbeat service.
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
Collection<NamenodeHeartbeatService> getNamenodeHearbeatServices() {
|
Collection<NamenodeHeartbeatService> getNamenodeHeartbeatServices() {
|
||||||
return this.namenodeHeartbeatServices;
|
return this.namenodeHeartbeatServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ public void testNoNamenodesAvailable() throws Exception{
|
|||||||
for (RouterContext routerContext : cluster.getRouters()) {
|
for (RouterContext routerContext : cluster.getRouters()) {
|
||||||
// Manually trigger the heartbeat
|
// Manually trigger the heartbeat
|
||||||
Collection<NamenodeHeartbeatService> heartbeatServices = routerContext
|
Collection<NamenodeHeartbeatService> heartbeatServices = routerContext
|
||||||
.getRouter().getNamenodeHearbeatServices();
|
.getRouter().getNamenodeHeartbeatServices();
|
||||||
for (NamenodeHeartbeatService service : heartbeatServices) {
|
for (NamenodeHeartbeatService service : heartbeatServices) {
|
||||||
service.periodicInvoke();
|
service.periodicInvoke();
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ public void testNamenodeMonitoring() throws Exception {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Collection<NamenodeHeartbeatService> heartbeatServices = routerContext
|
Collection<NamenodeHeartbeatService> heartbeatServices = routerContext
|
||||||
.getRouter().getNamenodeHearbeatServices();
|
.getRouter().getNamenodeHeartbeatServices();
|
||||||
// manually trigger the heartbeat
|
// manually trigger the heartbeat
|
||||||
for (NamenodeHeartbeatService service : heartbeatServices) {
|
for (NamenodeHeartbeatService service : heartbeatServices) {
|
||||||
service.periodicInvoke();
|
service.periodicInvoke();
|
||||||
|
Loading…
Reference in New Issue
Block a user