HDFS-WriterApp-Fixed all the code review comments
[demo.git] / vnfs / DAaaS / microservices / GoApps / src / go-hdfs-writer / pkg / utils / hdfsUtils.go
1 package utils
2
3 import (
4         "fmt"
5         "github.com/colinmarc/hdfs"
6 )
7
8
9 //CreateHdfsClient creates a hdfs client and returns hdfs client
10 func CreateHdfsClient(hdfsURL string) (*hdfs.Client){
11         slogger := GetLoggerInstance()
12         hdfsClient, hdfsConnectError := hdfs.New(hdfsURL)
13         if hdfsConnectError !=nil {
14                 slogger.Fatalf(":::Error in create hdfsClient::: %v", hdfsConnectError)
15                 fmt.Printf("::Unable to initialize hdfsURL, check logs")
16         }
17         return hdfsClient
18 }