Collectd operator utilties
[demo.git] / vnfs / DAaaS / GoApps / src / hdfs-writer / cmd / main.go
1 package main
2
3 import (
4         "os"
5         "fmt"
6         "log"
7         "github.com/colinmarc/hdfs/v2"
8 )
9
10 func main() {
11         log.Println("Starting the HDFS writer")
12         localSourceFile := os.Args[1]
13         hdfsDestination := os.Args[2]
14
15         log.Println("localSourceFile:: "+localSourceFile)
16         log.Println("hdfsDestination:: "+hdfsDestination)
17
18         client, _ := hdfs.New("hdfs://hdfs-1-namenode-1.hdfs-1-namenode.hdfs1.svc.cluster.local:8020")
19         file, _ := client.Open("/kafka.txt")
20
21         buf := make([]byte, 59)
22         file.ReadAt(buf, 48847)
23         fmt.Println(string(buf))
24
25 }