mirror of
https://github.com/talent-plan/tinykv.git
synced 2025-01-01 07:50:11 +08:00
5e089a2cd1
Signed-off-by: Connor <zbk602423539@gmail.com> Co-authored-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: linning <linningde25@gmail.com> Co-authored-by: YangKeao <keao.yang@yahoo.com> Co-authored-by: andylokandy <andylokandy@hotmail.com> Co-authored-by: Iosmanthus Teng <myosmanthustree@gmail.com>
22 lines
660 B
Go
22 lines
660 B
Go
package storage
|
|
|
|
import (
|
|
"github.com/pingcap-incubator/tinykv/kv/util/engine_util"
|
|
"github.com/pingcap-incubator/tinykv/proto/pkg/kvrpcpb"
|
|
)
|
|
|
|
// Storage represents the internal-facing server part of TinyKV, it handles sending and receiving from other
|
|
// TinyKV nodes. As part of that responsibility, it also reads and writes data to disk (or semi-permanent memory).
|
|
type Storage interface {
|
|
Start() error
|
|
Stop() error
|
|
Write(ctx *kvrpcpb.Context, batch []Modify) error
|
|
Reader(ctx *kvrpcpb.Context) (StorageReader, error)
|
|
}
|
|
|
|
type StorageReader interface {
|
|
GetCF(cf string, key []byte) ([]byte, error)
|
|
IterCF(cf string) engine_util.DBIterator
|
|
Close()
|
|
}
|