func normalizePaths(paths []string) ([]string, *hdfs.Client, error) {

	namenode := ""
	abPath := ""

	cleanPaths := make([]string, 0, len(paths))

	for _, rawurl := range paths {
		fsUrl, err := url.Parse(rawurl)

		if err != nil {
			return nil, nil, err
		}

		if fsUrl.Host != "" {
			if namenode != "" && namenode != fsUrl.Host {
				return nil, nil, errMultipleNamenodeUrls
			}
			namenode = fsUrl.Host
		}
		cleanPaths = append(cleanPaths, path.Clean(fsUrl.Path))
	}

	conf, err := hadoopconf.LoadFromEnvironment()
	if err != nil {
		return cleanPaths, nil, fmt.Errorf("NormalizePaths occur problem loading configuration: %s", err)
	}

	viewfs := strings.Split(conf["fs.defaultFS"], "/")[2]
	prefixPath := "fs.viewfs.mounttable." + viewfs + ".link."

	if namenode != "" {
		abPath = getCleanPath(cleanPaths, prefixPath, conf)
		client, err := getActiveNameNode(namenode, abPath)
		return cleanPaths, client, err
	}

	prefixNNX := "dfs.ha.namenodes."
	prefixNode := "dfs.namenode.rpc-address."

	if strings.Contains(conf["fs.defaultFS"], "hdfs://") { // not viewfs
		fsUrl := strings.Split(viewfs, ":")[0]
		nnxArray := strings.Split(conf[prefixNNX+fsUrl], ",")
		namenode = getNameNodeFromConf(nnxArray, prefixNode, fsUrl, conf)

		abPath = getCleanPath(cleanPaths, prefixPath, conf)
		client, err := getActiveNameNode(namenode, abPath)
		return cleanPaths, client, err
	}

	abPath = getCleanPath(cleanPaths, prefixPath, conf)
	node := conf[prefixPath+abPath]

	u, err := url.Parse(node)
	if err != nil {
		return nil, nil, err
	}

	pathNode := strings.Split(u.Host, ":")
	nnxArray := strings.Split(conf[prefixNNX+pathNode[0]], ",")             // nn3,nn4
	namenode = getNameNodeFromConf(nnxArray, prefixNode, pathNode[0], conf) // rsync.master003.sunshine.hadoop.js.ted:8020,rsync.master004.sunshine.hadoop.js.ted:8020
	activennCli, err := getActiveNameNode(namenode, abPath)

	return cleanPaths, activennCli, err
}
// normalizePaths parses the hosts out of HDFS URLs, and turns relative paths
// into absolute ones (by appending /user/<user>). If multiple HDFS urls with
// differing hosts are passed in, it returns an error.
normalizePaths parses the hosts out of HDFS URLs, and turns relative paths
into absolute ones (by appending /user/). If multiple HDFS urls with
differing hosts are passed in, it returns an error.
// normalizePaths parses the hosts out of HDFS URLs and turns relative paths // into absolute ones ( by appending / user / <user > ) . If multiple HDFS urls with // differing hosts are passed in it returns an error .
func normalizePaths(paths []string) ([]string, *hdfs.Client, error) {
	namenode := ""
	abPath := ""
	cleanPaths := make([]string, 0, len(paths))
	for _, rawurl := range paths {
		fsUrl, err := url.Parse(rawurl)
		if err != nil {
			return nil, nil, err
		}
		if fsUrl.Host != "" {
			if namenode != "" && namenode != fsUrl.Host {
				return nil, nil, errMultipleNamenodeUrls
			}
			namenode = fsUrl.Host
		}
		cleanPaths = append(cleanPaths, path.Clean(fsUrl.Path))
	}
	conf, err := hadoopconf.LoadFromEnvironment()
	if err != nil {
		return cleanPaths, nil, fmt.Errorf("NormalizePaths occur problem loading configuration: %s", err)
	}
	viewfs := strings.Split(conf["fs.defaultFS"], "/")[2]
	prefixPath := "fs.viewfs.mounttable." + viewfs + ".link."
	if namenode != "" {
		abPath = getCleanPath(cleanPaths, prefixPath, conf)
		client, err := getActiveNameNode(namenode, abPath)
		return cleanPaths, client, err
	}
	prefixNNX := "dfs.ha.namenodes."
	prefixNode := "dfs.namenode.rpc-address."
	if strings.Contains(conf["fs.defaultFS"], "hdfs://") { 
		fsUrl := strings.Split(viewfs, ":")[0]
		nnxArray := strings.Split(conf[prefixNNX+fsUrl], ",")
		namenode = getNameNodeFromConf(nnxArray, prefixNode, fsUrl, conf)
		abPath = getCleanPath(cleanPaths, prefixPath, conf)
		client, err := getActiveNameNode(namenode, abPath)
		return cleanPaths, client, err
	}
	abPath = getCleanPath(cleanPaths, prefixPath, conf)
	node := conf[prefixPath+abPath]
	u, err := url.Parse(node)
	if err != nil {
		return nil, nil, err
	}
	pathNode := strings.Split(u.Host, ":")
	nnxArray := strings.Split(conf[prefixNNX+pathNode[0]], ",")             
	namenode = getNameNodeFromConf(nnxArray, prefixNode, pathNode[0], conf) 
	activennCli, err := getActiveNameNode(namenode, abPath)
	return cleanPaths, activennCli, err
}
func normalizePaths ( paths [ ] string ) ( [ ] string , * hdfs . Client , error ) { namenode := " " abPath := " " cleanPaths := make ( [ ] string , 0 , len ( paths ) ) for _ , rawurl := range paths { fsUrl , err := url . Parse ( rawurl ) if err != nil { return nil , nil , err } if fsUrl . Host != " " { if namenode != " " && namenode != fsUrl . Host { return nil , nil , errMultipleNamenodeUrls } namenode = fsUrl . Host } cleanPaths = append ( cleanPaths , path . Clean ( fsUrl . Path ) ) } conf , err := hadoopconf . LoadFromEnvironment ( ) if err != nil { return cleanPaths , nil , fmt . Errorf ( " " , err ) } viewfs := strings . Split ( conf [ " " ] , " " ) [ 2 ] prefixPath := " " + viewfs + " " if namenode != " " { abPath = getCleanPath ( cleanPaths , prefixPath , conf ) client , err := getActiveNameNode ( namenode , abPath ) return cleanPaths , client , err } prefixNNX := " " prefixNode := " " if strings . Contains ( conf [ " " ] , " " ) { fsUrl := strings . Split ( viewfs , " " ) [ 0 ] nnxArray := strings . Split ( conf [ prefixNNX + fsUrl ] , " " ) namenode = getNameNodeFromConf ( nnxArray , prefixNode , fsUrl , conf ) abPath = getCleanPath ( cleanPaths , prefixPath , conf ) client , err := getActiveNameNode ( namenode , abPath ) return cleanPaths , client , err } abPath = getCleanPath ( cleanPaths , prefixPath , conf ) node := conf [ prefixPath + abPath ] u , err := url . Parse ( node ) if err != nil { return nil , nil , err } pathNode := strings . Split ( u . Host , " " ) nnxArray := strings . Split ( conf [ prefixNNX + pathNode [ 0 ] ] , " " ) namenode = getNameNodeFromConf ( nnxArray , prefixNode , pathNode [ 0 ] , conf ) activennCli , err := getActiveNameNode ( namenode , abPath ) return cleanPaths , activennCli , err }
normalizePaths parses the hosts out of HDFS URLs, and turns relative paths
into absolute ones (by appending /user/).
normalizePaths parses the hosts out of HDFS URLs and turns relative paths into absolute ones ( by appending / user / ) .
// not viewfs // nn3,nn4 // rsync.master003.sunshine.hadoop.js.ted:8020,rsync.master004.sunshine.hadoop.js.ted:8020