code: private void checkAndSetServiceName(Configuration conf, StartupInfo info) 
                throws ConfigurationException {
      String fedrationMode = conf.get(FSConstants.DFS_FEDERATION_NAMESERVICES);
      String serviceName = info.serviceName;
      
      if (fedrationMode != null && !fedrationMode.trim().isEmpty()) {
        if (serviceName == null || serviceName.trim().isEmpty()) {
          throw new ConfigurationException("This is a fedrated DFS cluster, nameservice id is required.");
        }
        this.serviceName = serviceName;
      }
    }
docs: Check if this is a fedrated cluster and set the service name.
  @throws ConfigurationException