mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
server: Extract hasher to separate interface
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
@@ -112,7 +112,6 @@ const (
|
||||
type KV interface {
|
||||
ReadView
|
||||
WriteView
|
||||
Hasher
|
||||
|
||||
// Read creates a read transaction.
|
||||
Read(mode ReadTxMode, trace *traceutil.Trace) TxnRead
|
||||
@@ -120,6 +119,9 @@ type KV interface {
|
||||
// Write creates a write transaction.
|
||||
Write(trace *traceutil.Trace) TxnWrite
|
||||
|
||||
// HashStorage returns HashStorage interface for KV storage.
|
||||
HashStorage() HashStorage
|
||||
|
||||
// Compact frees all superseded keys with revisions less than rev.
|
||||
Compact(trace *traceutil.Trace, rev int64) (<-chan struct{}, error)
|
||||
|
||||
@@ -131,14 +133,6 @@ type KV interface {
|
||||
Close() error
|
||||
}
|
||||
|
||||
type Hasher interface {
|
||||
// Hash computes the hash of the KV's backend.
|
||||
Hash() (hash uint32, revision int64, err error)
|
||||
|
||||
// HashByRev computes the hash of all MVCC revisions up to a given revision.
|
||||
HashByRev(rev int64) (hash KeyValueHash, revision int64, err error)
|
||||
}
|
||||
|
||||
// WatchableKV is a KV that can be watched.
|
||||
type WatchableKV interface {
|
||||
KV
|
||||
|
||||
Reference in New Issue
Block a user