@Override
  public boolean enterMaintenanceMode(String reason) {
    if (reason == null || reason.isEmpty()) {
      throw new IllegalArgumentException("Reason to enter maintenance mode is missing");
    }
    boolean enterMaintenanceMode = false;
    synchronized (helixAdministrationLock) {
      if (inMaintenanceMode) {
        throw new IllegalStateException("Cluster already in maintenance mode: " + maintenanceModeReason);
      }
      try {
        // First check if cluster is already in maintenance mode.
        if (helixAdmin.isInMaintenanceMode(clusterName)) {
          logger.error("Cluster already in maintenance mode, probably due to other reason");
          return false;
        }
        helixAdmin.manuallyEnableMaintenanceMode(clusterName, true, reason, null);
        inMaintenanceMode = true;
        maintenanceModeReason = reason;
        logger.info("Cluster {} enters maintenance mode because {}", clusterName, reason);
        enterMaintenanceMode = true;
      } catch (Exception e) {
        logger.error("Exception occurred when entering maintenance mode", e);
      }
    }
    return enterMaintenanceMode;
  }
Given a map of old disks and new disks, swaps the old disks with the new disks in the DataNodeConfig,
and persists the resulting changes to Helix.
@param newDiskMapping A map of old disks to new disks.
@return {@code true} if the disks order was successfully updated, {@code false} otherwise.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixParticipant.java