Documentation ¶
Index ¶
- type Delete
- type MemStorage
- func (s *MemStorage) Get(cf string, key []byte) []byte
- func (s *MemStorage) HasChanged(cf string, key []byte) bool
- func (s *MemStorage) Len(cf string) int
- func (s *MemStorage) Reader(ctx *kvrpcpb.Context) (StorageReader, error)
- func (s *MemStorage) Set(cf string, key []byte, value []byte)
- func (s *MemStorage) Start() error
- func (s *MemStorage) Stop() error
- func (s *MemStorage) Write(ctx *kvrpcpb.Context, batch []Modify) error
- type Modify
- type Put
- type Storage
- type StorageReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStorage ¶
MemStorage is an in-memory storage engine used for testing. Data is not written to disk, nor sent to other nodes. It is intended for testing only.
func NewMemStorage ¶
func NewMemStorage() *MemStorage
func (*MemStorage) HasChanged ¶
func (s *MemStorage) HasChanged(cf string, key []byte) bool
func (*MemStorage) Len ¶
func (s *MemStorage) Len(cf string) int
func (*MemStorage) Reader ¶
func (s *MemStorage) Reader(ctx *kvrpcpb.Context) (StorageReader, error)
func (*MemStorage) Start ¶
func (s *MemStorage) Start() error
func (*MemStorage) Stop ¶
func (s *MemStorage) Stop() error
type Modify ¶
type Modify struct {
Data interface{}
}
Modify is a single modification to TinyKV's underlying storage.
type Storage ¶
type Storage interface { Start() error Stop() error Write(ctx *kvrpcpb.Context, batch []Modify) error Reader(ctx *kvrpcpb.Context) (StorageReader, error) }
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 StorageReader ¶
type StorageReader interface { // When the key doesn't exist, return nil for the value GetCF(cf string, key []byte) ([]byte, error) IterCF(cf string) engine_util.DBIterator Close() }
Click to show internal directories.
Click to hide internal directories.