Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cmd/dgraph/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"github.com/dgraph-io/dgraph/uid"
"github.com/dgraph-io/dgraph/worker"
"github.com/dgraph-io/dgraph/x"
"os"
)

var postingDir = flag.String("postings", "", "Directory to store posting lists")
Expand Down Expand Up @@ -319,6 +320,20 @@ func main() {
if *port%2 != 0 {
log.Fatalf("Port should be an even number: %v", *port)
}
// Create parent directories for postings, uids and mutations
var err error
err = os.MkdirAll(*postingDir, 0700)
if err != nil {
log.Fatal("Error while creating the filepath for postings: %v", err)
}
err = os.MkdirAll(*mutationDir, 0700)
if err != nil {
log.Fatal("Error while creating the filepath for mutations: %v", err)
}
err = os.MkdirAll(*uidDir, 0700)
if err != nil {
log.Fatal("Error while creating the filepath for uids: %v", err)
}

ps := new(store.Store)
ps.Init(*postingDir)
Expand All @@ -337,6 +352,7 @@ func main() {
}

posting.Init(clog)

if *instanceIdx != 0 {
worker.Init(ps, nil, *instanceIdx, lenAddr)
uid.Init(nil)
Expand Down