This repository has been archived on 2022-07-30. You can view files and clone it, but cannot push or open issues/pull-requests.
2022-07-26 12:02:32 +00:00
|
|
|
package mdb
|
|
|
|
|
|
|
|
type WALStatus struct {
|
2022-07-26 12:13:41 +00:00
|
|
|
MaxSeqNumKV uint64
|
|
|
|
MaxSeqNumWAL uint64
|
2022-07-26 12:02:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type itemIndex[T any] interface {
|
|
|
|
load(m map[uint64]*T) error
|
|
|
|
insert(*T)
|
|
|
|
update(old, new *T) // Old and new MUST have the same ID.
|
|
|
|
delete(*T)
|
|
|
|
}
|
|
|
|
|
|
|
|
type itemUniqueIndex[T any] interface {
|
|
|
|
load(m map[uint64]*T) error
|
|
|
|
name() string
|
|
|
|
lock(*T)
|
|
|
|
unlock(*T)
|
|
|
|
insertConflict(*T) bool
|
|
|
|
updateConflict(*T) bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type dbCollection interface {
|
|
|
|
loadData()
|
|
|
|
onStore(string, uint64, []byte) // For WAL following.
|
|
|
|
onDelete(string, uint64) // For WAL following.
|
|
|
|
}
|