Added godoc comments for echovault.go exported functions

This commit is contained in:
Kelvin Mwinuka
2024-04-04 03:18:56 +08:00
parent 169fa39204
commit e42582ef66
3 changed files with 610 additions and 609 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -474,6 +474,7 @@ func (server *EchoVault) setLatestSnapshot(msec int64) {
server.latestSnapshotMilliseconds.Store(msec)
}
// GetLatestSnapshotTime returns the latest snapshot time in unix epoch milliseconds.
func (server *EchoVault) GetLatestSnapshotTime() int64 {
return server.latestSnapshotMilliseconds.Load()
}
@@ -486,6 +487,7 @@ func (server *EchoVault) finishRewriteAOF() {
server.rewriteAOFInProgress.Store(false)
}
// RewriteAOF triggers an AOF compaction when running in standalone mode.
func (server *EchoVault) RewriteAOF() error {
if server.rewriteAOFInProgress.Load() {
return errors.New("aof rewrite in progress")
@@ -498,6 +500,8 @@ func (server *EchoVault) RewriteAOF() error {
return nil
}
// ShutDown gracefully shuts down the EchoVault instance.
// This function shuts down the memberlist and raft layers.
func (server *EchoVault) ShutDown() {
if server.isInCluster() {
server.raft.RaftShutdown()

View File

@@ -39,9 +39,6 @@ type EchoVault interface {
TakeSnapshot() error
RewriteAOF() error
GetLatestSnapshotTime() int64
//StartSnapshot()
//FinishSnapshot()
//SetLatestSnapshot(msec int64)
}
type KeyExtractionFunc func(cmd []string) ([]string, error)