MCPcopy
hub / github.com/dgraph-io/dgraph / Init

Method Init

dgraph/cmd/zero/oracle.go:46–55  ·  view source on GitHub ↗

Init initializes the oracle.

()

Source from the content-addressed store, hash-verified

44
45// Init initializes the oracle.
46func (o *Oracle) Init() {
47 o.commits = make(map[uint64]uint64)
48 // Remove the older btree file, before creating NewTree, as it may contain stale data leading
49 // to wrong results.
50 o.keyCommit = z.NewTree("oracle")
51 o.subscribers = make(map[int]chan pb.OracleDelta)
52 o.updates = make(chan *pb.OracleDelta, 100000) // Keeping 1 second worth of updates.
53 o.doneUntil.Init(nil)
54 go o.sendDeltasToSubscribers()
55}
56
57// close releases the memory associated with btree used for keycommit.
58func (o *Oracle) close() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected