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

Function printRaft

dgraph/cmd/debug/wal.go:131–146  ·  view source on GitHub ↗
(store *raftwal.DiskStorage)

Source from the content-addressed store, hash-verified

129}
130
131func printRaft(store *raftwal.DiskStorage) {
132 isZero := store.Uint(raftwal.GroupId) == 0
133
134 pending := make(map[uint64]bool)
135 startIdx, lastIdx := printBasic(store)
136
137 for startIdx < lastIdx {
138 entries, err := store.Entries(startIdx, lastIdx+1, 64<<20)
139 x.Check(err)
140 for _, ent := range entries {
141 printEntry(ent, pending, isZero)
142 startIdx = x.Max(startIdx, ent.Index)
143 }
144 startIdx = startIdx + 1
145 }
146}
147
148func overwriteSnapshot(store *raftwal.DiskStorage) error {
149 snap, err := store.Snapshot()

Callers 1

handleWalFunction · 0.85

Calls 6

CheckFunction · 0.92
MaxFunction · 0.92
printBasicFunction · 0.85
printEntryFunction · 0.85
EntriesMethod · 0.80
UintMethod · 0.45

Tested by

no test coverage detected