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

Function Init

posting/lists.go:37–43  ·  view source on GitHub ↗

Init initializes the posting lists package, the in memory and dirty list hash.

(ps *badger.DB, cacheSize int64, removeOnUpdate bool)

Source from the content-addressed store, hash-verified

35
36// Init initializes the posting lists package, the in memory and dirty list hash.
37func Init(ps *badger.DB, cacheSize int64, removeOnUpdate bool) {
38 pstore = ps
39 closer = z.NewCloser(1)
40 go x.MonitorMemoryMetrics(closer)
41
42 MemLayerInstance = initMemoryLayer(cacheSize, removeOnUpdate)
43}
44
45func SetEnabledDetailedMetrics(enableMetrics bool) {
46 EnableDetailedMetrics = enableMetrics

Callers 15

runMethod · 0.92
runFunction · 0.92
runFunction · 0.92
TestEmptyTypeSchemaFunction · 0.92
TestGetScalarListFunction · 0.92
TestMultipleTxnListCountFunction · 0.92
TestScalarPredicateCountFunction · 0.92
TestSingleUidReplacementFunction · 0.92
TestSingleStringFunction · 0.92

Calls 2

MonitorMemoryMetricsFunction · 0.92
initMemoryLayerFunction · 0.85

Tested by 15

TestEmptyTypeSchemaFunction · 0.74
TestGetScalarListFunction · 0.74
TestMultipleTxnListCountFunction · 0.74
TestScalarPredicateCountFunction · 0.74
TestSingleUidReplacementFunction · 0.74
TestSingleStringFunction · 0.74
TestLangExactFunction · 0.74
TestReverseEdgeFunction · 0.74