aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/microservices/GoApps/src/go-hdfs-writer/pkg/utils/hdfsUtils.go
blob: 8edcec19d348eb5e9a3dd36049b8340092af9db4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package utils

import (
	"fmt"
	"github.com/colinmarc/hdfs"
)


//CreateHdfsClient creates a hdfs client and returns hdfs client
func CreateHdfsClient(hdfsURL string) (*hdfs.Client){
	slogger := GetLoggerInstance()
	hdfsClient, hdfsConnectError := hdfs.New(hdfsURL)
	if hdfsConnectError !=nil {
		slogger.Fatalf(":::Error in create hdfsClient::: %v", hdfsConnectError)
		fmt.Printf("::Unable to initialize hdfsURL, check logs")
	}
	return hdfsClient
}