diff options
author | Rajamohan Raj <rajamohan.raj@intel.com> | 2019-05-23 12:47:06 -0700 |
---|---|---|
committer | Gary Wu <gwu@futurewei.com> | 2019-05-23 21:23:31 +0000 |
commit | bc5fdda854e73daf42f6b275ed75d06c12dc6b09 (patch) | |
tree | 0152da029c92da5a1eba171b6d6147163cf3a010 /vnfs/DAaaS/GoApps/src/hdfs-writer/cmd | |
parent | 6ed2a1bb9ba878059eaf23e499e73f1b9e7a7bfe (diff) |
Sample file reading from hdfs.
Just a sample go file for reading from a hdfs file.
Shall be deleted later.
Issue-ID: ONAPARC-451
Signed-off-by: Rajamohan Raj <rajamohan.raj@intel.com>
Change-Id: Icfdd4b2196e080b6da45dadaf498eeb5d5fba1ac
Diffstat (limited to 'vnfs/DAaaS/GoApps/src/hdfs-writer/cmd')
-rw-r--r-- | vnfs/DAaaS/GoApps/src/hdfs-writer/cmd/main.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/vnfs/DAaaS/GoApps/src/hdfs-writer/cmd/main.go b/vnfs/DAaaS/GoApps/src/hdfs-writer/cmd/main.go index abc75fb7..11350f0b 100644 --- a/vnfs/DAaaS/GoApps/src/hdfs-writer/cmd/main.go +++ b/vnfs/DAaaS/GoApps/src/hdfs-writer/cmd/main.go @@ -1,11 +1,25 @@ package main import ( + "os" "fmt" "log" + "github.com/colinmarc/hdfs/v2" ) func main() { log.Println("Starting the HDFS writer") - fmt.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)) + } |