summaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/microservices/GoApps/src/hdfs-writer/cmd/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'vnfs/DAaaS/microservices/GoApps/src/hdfs-writer/cmd/main.go')
-rw-r--r--vnfs/DAaaS/microservices/GoApps/src/hdfs-writer/cmd/main.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/vnfs/DAaaS/microservices/GoApps/src/hdfs-writer/cmd/main.go b/vnfs/DAaaS/microservices/GoApps/src/hdfs-writer/cmd/main.go
new file mode 100644
index 00000000..11350f0b
--- /dev/null
+++ b/vnfs/DAaaS/microservices/GoApps/src/hdfs-writer/cmd/main.go
@@ -0,0 +1,25 @@
+package main
+
+import (
+ "os"
+ "fmt"
+ "log"
+ "github.com/colinmarc/hdfs/v2"
+)
+
+func main() {
+ log.Println("Starting the HDFS writer")
+ localSourceFile := os.Args[1]
+ hdfsDestination := os.Args[2]
+
+ log.Println("localSourceFile:: "+localSourceFile)
+ log.Println("hdfsDestination:: "+hdfsDestination)
+
+ client, _ := hdfs.New("hdfs://hdfs-1-namenode-1.hdfs-1-namenode.hdfs1.svc.cluster.local:8020")
+ file, _ := client.Open("/kafka.txt")
+
+ buf := make([]byte, 59)
+ file.ReadAt(buf, 48847)
+ fmt.Println(string(buf))
+
+}