MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / FirstIndex

Method FirstIndex

lib/datastore/rocksdb.go:37–43  ·  view source on GitHub ↗

FirstIndex is a method on RocksDbStore that returns the first index in the log

()

Source from the content-addressed store, hash-verified

35
36// FirstIndex is a method on RocksDbStore that returns the first index in the log
37func (rds *RocksDbStore) FirstIndex() (uint64, error) {
38 ro := gorocksdb.NewDefaultReadOptions()
39 defer ro.Destroy()
40 it := rds.conn.NewIterator(ro)
41 it.SeekToFirst()
42 return bytesToUint64(it.Key().Data()), nil
43}
44
45// LastIndex is a method on RocksDbStore that returns the last index in the log
46func (rds *RocksDbStore) LastIndex() (uint64, error) {

Callers

nothing calls this directly

Calls 3

KeyMethod · 0.95
bytesToUint64Function · 0.85
NewIteratorMethod · 0.80

Tested by

no test coverage detected