@VisibleForTesting
  void copyHAProperties(String defaultFS) throws URISyntaxException, HdfsApiException {
    URI uri = new URI(defaultFS);
    String nameservice = uri.getHost();

    copyClusterProperty(NAMESERVICES_CLUSTER_PROPERTY, NAMESERVICES_INSTANCE_PROPERTY);
    String namenodeIDs = copyClusterProperty(String.format(HA_NAMENODES_CLUSTER_PROPERTY, nameservice),
      HA_NAMENODES_INSTANCE_PROPERTY);

    String[] namenodes = namenodeIDs.split(",");
    //    get the property values from cluster.
    //    If not found then get the values from view instance property.

    List<String> rpcAddresses = new ArrayList<>(namenodes.length);
    List<String> httpAddresses = new ArrayList<>(namenodes.length);
    List<String> httpsAddresses = new ArrayList<>(namenodes.length);
    for (String namenode : namenodes) {

      String rpcAddress = getProperty(HDFS_SITE, String.format(NAMENODE_RPC_NN_CLUSTER_PROPERTY, nameservice, namenode));
      if(!Strings.isNullOrEmpty(rpcAddress)) {
        rpcAddresses.add(rpcAddress);
      }

      String httpAddress = getProperty(HDFS_SITE, String.format(NAMENODE_HTTP_NN_CLUSTER_PROPERTY, nameservice, namenode));
      if(!Strings.isNullOrEmpty(httpAddress)) {
        httpAddresses.add(httpAddress);
      }

      String httpsAddress = getProperty(HDFS_SITE, String.format(NAMENODE_HTTPS_NN_CLUSTER_PROPERTY, nameservice, namenode));
      if(!Strings.isNullOrEmpty(httpsAddress)) {
        httpsAddresses.add(httpsAddress);
      }
    }

    addAddresses(rpcAddresses, NAMENODE_RPC_NN_INSTANCE_PROPERTY);
    addAddresses(httpAddresses, NAMENODE_HTTP_NN_INSTANCE_PROPERTY);
    addAddresses(httpsAddresses, NAMENODE_HTTPS_NN_INSTANCE_PROPERTY);

    for (int i = 0 ; i < namenodes.length ; i++) {
      conf.set( String.format(NAMENODE_RPC_NN_CLUSTER_PROPERTY, nameservice, namenodes[i]), rpcAddresses.get(i));
      conf.set( String.format(NAMENODE_HTTP_NN_CLUSTER_PROPERTY, nameservice, namenodes[i]), httpAddresses.get(i));
      conf.set( String.format(NAMENODE_HTTPS_NN_CLUSTER_PROPERTY, nameservice, namenodes[i]), httpsAddresses.get(i));
    }

    copyClusterProperty(String.format(FAILOVER_PROXY_PROVIDER_CLUSTER_PROPERTY, nameservice),
      FAILOVER_PROXY_PROVIDER_INSTANCE_PROPERTY);
  }
takes context and any extra custom properties that needs to be included into config
@param context
@param customProperties
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/ConfigurationBuilder.java