MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / firstEmptySlot

Method firstEmptySlot

raftwal/log.go:191–196  ·  view source on GitHub ↗

firstEmptySlot returns the index of the first empty slot in the file.

()

Source from the content-addressed store, hash-verified

189
190// firstEmptySlot returns the index of the first empty slot in the file.
191func (lf *logFile) firstEmptySlot() int {
192 return sort.Search(maxNumEntries, func(i int) bool {
193 e := lf.getEntry(i)
194 return e.Index() == 0
195 })
196}
197
198// lastEntry returns the last valid entry in the file.
199func (lf *logFile) lastEntry() entry {

Callers 2

lastEntryMethod · 0.95
openWalFunction · 0.80

Calls 3

getEntryMethod · 0.95
IndexMethod · 0.80
SearchMethod · 0.65

Tested by

no test coverage detected