Skip to content
Snippets Groups Projects
Commit dfae5ca1 authored by Ashwin's avatar Ashwin
Browse files

RocksDB merging in golang

parent 3be07857
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -21,7 +21,6 @@ import ( ...@@ -21,7 +21,6 @@ import (
"bytes" "bytes"
"container/heap" "container/heap"
"flag" "flag"
"fmt"
"io/ioutil" "io/ioutil"
"github.com/dgraph-io/dgraph/store/rocksdb" "github.com/dgraph-io/dgraph/store/rocksdb"
...@@ -90,7 +89,7 @@ func main() { ...@@ -90,7 +89,7 @@ func main() {
var itVec []*rocksdb.Iterator var itVec []*rocksdb.Iterator
var db *rocksdb.DB var db *rocksdb.DB
var lastKey, lastValue []bytes var lastKey, lastValue []byte
count := 0 count := 0
for range files { for range files {
count++ count++
...@@ -109,7 +108,6 @@ func main() { ...@@ -109,7 +108,6 @@ func main() {
if !it.Valid() { if !it.Valid() {
continue continue
} }
fmt.Println(it.Key(), it.Value())
pq[i] = &Item{ pq[i] = &Item{
key: it.Key(), key: it.Key(),
value: it.Value(), value: it.Value(),
...@@ -127,7 +125,6 @@ func main() { ...@@ -127,7 +125,6 @@ func main() {
Fatal("While opening store") Fatal("While opening store")
} }
fmt.Println(count)
for pq.Len() > 0 { for pq.Len() > 0 {
top := heap.Pop(&pq).(*Item) top := heap.Pop(&pq).(*Item)
...@@ -137,7 +134,6 @@ func main() { ...@@ -137,7 +134,6 @@ func main() {
} }
} else { } else {
db.Put(wopt, top.key, top.value) db.Put(wopt, top.key, top.value)
fmt.Println(top.key, top.value)
lastKey = top.key lastKey = top.key
lastValue = top.value lastValue = top.value
} }
...@@ -153,6 +149,5 @@ func main() { ...@@ -153,6 +149,5 @@ func main() {
} }
heap.Push(&pq, item) heap.Push(&pq, item)
} }
fmt.Println(count)
db.Close() db.Close()
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment