mirror of
https://github.com/talent-plan/tinykv.git
synced 2025-02-12 04:40:15 +08:00
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>
39 lines
953 B
Go
39 lines
953 B
Go
package standalone_storage
|
|
|
|
import (
|
|
"github.com/pingcap-incubator/tinykv/kv/config"
|
|
"github.com/pingcap-incubator/tinykv/kv/storage"
|
|
"github.com/pingcap-incubator/tinykv/proto/pkg/kvrpcpb"
|
|
)
|
|
|
|
// StandAloneStorage is an implementation of `Storage` for a single-node TinyKV instance. It does not
|
|
// communicate with other nodes and all data is stored locally.
|
|
type StandAloneStorage struct {
|
|
// Your Data Here (1).
|
|
}
|
|
|
|
func NewStandAloneStorage(conf *config.Config) *StandAloneStorage {
|
|
// Your Code Here (1).
|
|
return nil
|
|
}
|
|
|
|
func (s *StandAloneStorage) Start() error {
|
|
// Your Code Here (1).
|
|
return nil
|
|
}
|
|
|
|
func (s *StandAloneStorage) Stop() error {
|
|
// Your Code Here (1).
|
|
return nil
|
|
}
|
|
|
|
func (s *StandAloneStorage) Reader(ctx *kvrpcpb.Context) (storage.StorageReader, error) {
|
|
// Your Code Here (1).
|
|
return nil, nil
|
|
}
|
|
|
|
func (s *StandAloneStorage) Write(ctx *kvrpcpb.Context, batch []storage.Modify) error {
|
|
// Your Code Here (1).
|
|
return nil
|
|
}
|