MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / NewDataStore

Function NewDataStore

store/engine/raft/store.go:58–68  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

56}
57
58func NewDataStore(dir string) *DataStore {
59 snapshotDir := fmt.Sprintf("%s/snapshot", dir)
60 snapshotter := snap.New(logger.Get(), snapshotDir)
61 return &DataStore{
62 walDir: fmt.Sprintf("%s/wal", dir),
63 snapshotDir: snapshotDir,
64 snapshotter: snapshotter,
65 raftStorage: raft.NewMemoryStorage(),
66 kvs: make(map[string][]byte),
67 }
68}
69
70func (ds *DataStore) walExists() bool {
71 return wal.Exist(ds.walDir)

Callers 2

NewFunction · 0.85
TestDataStoreFunction · 0.85

Calls 1

GetFunction · 0.92

Tested by 1

TestDataStoreFunction · 0.68