MaintenanceRecord getLastMaintenanceRecord() throws Exception {
    PropertyKey.Builder keyBuilder = new PropertyKey.Builder(clusterName);
    PropertyKey key = keyBuilder.controllerLeaderHistory();
    ControllerHistory controllerHistory = manager.getHelixDataAccessor().getProperty(key);
    List<String> maintenanceHistory = controllerHistory.getMaintenanceHistoryList();
    if (maintenanceHistory == null || maintenanceHistory.isEmpty()) {
      throw new IllegalStateException("Missing maintenance history");
    }
    String serializedRecord = maintenanceHistory.get(maintenanceHistory.size() - 1);
    return objectMapper.readValue(serializedRecord, MaintenanceRecord.class);
  }
Get the latest maintenance record. We are assuming this will only be called after cluster enters maintenance mode
so the maintanance record should not be empty. It will throw an exception if there is no maintenance record present
in helix.
@return The latest {@link MaintenanceRecord}.
@throws Exception
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixParticipant.java