mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
raft cluster
wip: raft does not care about migrating wip: optimize code wip: raft election wip wip: fix raft leader missing log entries wip fix a dead lock batch set slot route wip: raft persist wip refactor cluster suite remove relay rename relay2 refactor: allow customizing client factory test raft refactor re-balance avoid errors caused by inconsistent status on follower nodes during raft commits test raft election
This commit is contained in:
@@ -15,6 +15,10 @@ type DB interface {
|
||||
Close()
|
||||
}
|
||||
|
||||
// KeyEventCallback will be called back on key event, such as key inserted or deleted
|
||||
// may be called concurrently
|
||||
type KeyEventCallback func(dbIndex int, key string, entity *DataEntity)
|
||||
|
||||
// DBEngine is the embedding storage engine exposing more methods for complex application
|
||||
type DBEngine interface {
|
||||
DB
|
||||
@@ -25,6 +29,10 @@ type DBEngine interface {
|
||||
RWLocks(dbIndex int, writeKeys []string, readKeys []string)
|
||||
RWUnLocks(dbIndex int, writeKeys []string, readKeys []string)
|
||||
GetDBSize(dbIndex int) (int, int)
|
||||
GetEntity(dbIndex int, key string) (*DataEntity, bool)
|
||||
GetExpiration(dbIndex int, key string) *time.Time
|
||||
SetKeyInsertedCallback(cb KeyEventCallback)
|
||||
SetKeyDeletedCallback(cb KeyEventCallback)
|
||||
}
|
||||
|
||||
// DataEntity stores data bound to a key, including a string, list, hash, set and so on
|
||||
|
Reference in New Issue
Block a user