diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java index 114f0087290..35097682214 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java @@ -283,6 +283,13 @@ public class RouterAdminServer extends AbstractService this.router.updateRouterState(RouterServiceState.SAFEMODE); safeModeService.setManualSafeMode(true); success = verifySafeMode(true); + if (success) { + LOG.info("STATE* Safe mode is ON.\n" + "It was turned on manually. " + + "Use \"hdfs dfsrouteradmin -safemode leave\" to turn" + + " safe mode off."); + } else { + LOG.error("Unable to enter safemode."); + } } return EnterSafeModeResponse.newInstance(success); } @@ -296,6 +303,11 @@ public class RouterAdminServer extends AbstractService this.router.updateRouterState(RouterServiceState.RUNNING); safeModeService.setManualSafeMode(false); success = verifySafeMode(false); + if (success) { + LOG.info("STATE* Safe mode is OFF.\n" + "It was turned off manually."); + } else { + LOG.error("Unable to leave safemode."); + } } return LeaveSafeModeResponse.newInstance(success); } @@ -307,6 +319,7 @@ public class RouterAdminServer extends AbstractService RouterSafemodeService safeModeService = this.router.getSafemodeService(); if (safeModeService != null) { isInSafeMode = safeModeService.isInSafeMode(); + LOG.info("Safemode status retrieved successfully."); } return GetSafeModeResponse.newInstance(isInSafeMode); } @@ -340,6 +353,11 @@ public class RouterAdminServer extends AbstractService boolean success = false; if (namespaceExists(nsId)) { success = getDisabledNameserviceStore().disableNameservice(nsId); + if (success) { + LOG.info("Nameservice {} disabled successfully.", nsId); + } else { + LOG.error("Unable to disable Nameservice {}", nsId); + } } else { LOG.error("Cannot disable {}, it does not exists", nsId); } @@ -373,6 +391,11 @@ public class RouterAdminServer extends AbstractService boolean success = false; if (disabled.contains(nsId)) { success = store.enableNameservice(nsId); + if (success) { + LOG.info("Nameservice {} enabled successfully.", nsId); + } else { + LOG.error("Unable to enable Nameservice {}", nsId); + } } else { LOG.error("Cannot enable {}, it was not disabled", nsId); }