store

package
v0.0.0-...-19f5321 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2020 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CacheSizeLimit = 1024 * 1024

Variables

View Source
var PhaseTrunkTime, PhaseEndWriteTime uint64

Functions

This section is empty.

Types

type BackwardIter

type BackwardIter struct {
	// contains filtered or unexported fields
}

func (*BackwardIter) Close

func (iter *BackwardIter) Close()

func (*BackwardIter) Domain

func (iter *BackwardIter) Domain() ([]byte, []byte)

func (*BackwardIter) Key

func (iter *BackwardIter) Key() []byte

func (*BackwardIter) Next

func (iter *BackwardIter) Next()

func (*BackwardIter) ObjValue

func (iter *BackwardIter) ObjValue(ptr *types.Serializable)

func (*BackwardIter) Valid

func (iter *BackwardIter) Valid() bool

func (*BackwardIter) Value

func (iter *BackwardIter) Value() []byte

type CacheStore

type CacheStore struct {
	// contains filtered or unexported fields
}

func NewCacheStore

func NewCacheStore() *CacheStore

func (*CacheStore) Close

func (cs *CacheStore) Close()

func (*CacheStore) Delete

func (cs *CacheStore) Delete(key []byte)

func (*CacheStore) Get

func (cs *CacheStore) Get(key []byte) (res []byte, status types.CacheStatus)

func (*CacheStore) GetObj

func (cs *CacheStore) GetObj(key []byte, ptr *types.Serializable) (status types.CacheStatus)

Move the object out from this cache, and left a Nil value in cache This object must be returned to cache using SetObj

func (*CacheStore) GetObjCopy

func (cs *CacheStore) GetObjCopy(key []byte, ptr *types.Serializable) (status types.CacheStatus)

Get the object's copy

func (*CacheStore) GetReadOnlyObj

func (cs *CacheStore) GetReadOnlyObj(key []byte, ptr *types.Serializable) (status types.CacheStatus)

Get the object and this object is still contained in cache, so the client must use the object as readonly

func (*CacheStore) Iterator

func (cs *CacheStore) Iterator(start, end []byte) types.ObjIterator

func (*CacheStore) RealDelete

func (cs *CacheStore) RealDelete(key []byte)

func (*CacheStore) ReverseIterator

func (cs *CacheStore) ReverseIterator(start, end []byte) types.ObjIterator

func (*CacheStore) ScanAllEntries

func (cs *CacheStore) ScanAllEntries(fn func(key []byte, obj interface{}, isDeleted bool))

func (*CacheStore) Set

func (cs *CacheStore) Set(key, value []byte)

func (*CacheStore) SetObj

func (cs *CacheStore) SetObj(key []byte, obj types.Serializable)

func (*CacheStore) Size

func (cs *CacheStore) Size() int

type ForwardIter

type ForwardIter struct {
	// contains filtered or unexported fields
}

func (*ForwardIter) Close

func (iter *ForwardIter) Close()

func (*ForwardIter) Domain

func (iter *ForwardIter) Domain() ([]byte, []byte)

func (*ForwardIter) Key

func (iter *ForwardIter) Key() []byte

func (*ForwardIter) Next

func (iter *ForwardIter) Next()

func (*ForwardIter) ObjValue

func (iter *ForwardIter) ObjValue(ptr *types.Serializable)

func (*ForwardIter) Valid

func (iter *ForwardIter) Valid() bool

func (*ForwardIter) Value

func (iter *ForwardIter) Value() []byte

type MockRootStore

type MockRootStore struct {
	// contains filtered or unexported fields
}

func NewMockRootStore

func NewMockRootStore() *MockRootStore

func (*MockRootStore) ActiveCount

func (rs *MockRootStore) ActiveCount() int

func (*MockRootStore) BeginWrite

func (rs *MockRootStore) BeginWrite()

func (*MockRootStore) CheckConsistency

func (rs *MockRootStore) CheckConsistency()

func (*MockRootStore) Close

func (rs *MockRootStore) Close()

func (*MockRootStore) Delete

func (rs *MockRootStore) Delete(key []byte)

func (*MockRootStore) EndWrite

func (rs *MockRootStore) EndWrite()

func (*MockRootStore) Get

func (rs *MockRootStore) Get(key []byte) []byte

func (*MockRootStore) GetObjCopy

func (rs *MockRootStore) GetObjCopy(key []byte, ptr *types.Serializable)

func (*MockRootStore) GetReadOnlyObj

func (rs *MockRootStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)

func (*MockRootStore) GetTrunkStore

func (rs *MockRootStore) GetTrunkStore() interface{}

func (*MockRootStore) Has

func (rs *MockRootStore) Has(key []byte) bool

func (*MockRootStore) Iterator

func (rs *MockRootStore) Iterator(start, end []byte) types.ObjIterator

func (*MockRootStore) PrepareForDeletion

func (rs *MockRootStore) PrepareForDeletion(key []byte)

func (*MockRootStore) PrepareForUpdate

func (rs *MockRootStore) PrepareForUpdate(key []byte)

func (*MockRootStore) ReverseIterator

func (rs *MockRootStore) ReverseIterator(start, end []byte) types.ObjIterator

func (*MockRootStore) Set

func (rs *MockRootStore) Set(key, value []byte)

func (*MockRootStore) SetHeight

func (rs *MockRootStore) SetHeight(h int64)

func (*MockRootStore) SetObj

func (rs *MockRootStore) SetObj(key []byte, obj types.Serializable)

type MultiStore

type MultiStore struct {
	// contains filtered or unexported fields
}

We use a new TrunkStore for transaction

func (*MultiStore) Close

func (ms *MultiStore) Close(writeBack bool)

func (*MultiStore) Delete

func (ms *MultiStore) Delete(key []byte)

func (*MultiStore) Get

func (ms *MultiStore) Get(key []byte) []byte

func (*MultiStore) GetObj

func (ms *MultiStore) GetObj(key []byte, ptr *types.Serializable)

func (*MultiStore) GetReadOnlyObj

func (ms *MultiStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)

func (*MultiStore) Has

func (ms *MultiStore) Has(key []byte) bool

func (*MultiStore) Iterator

func (ms *MultiStore) Iterator(start, end []byte) types.ObjIterator

func (*MultiStore) ReverseIterator

func (ms *MultiStore) ReverseIterator(start, end []byte) types.ObjIterator

func (*MultiStore) Set

func (ms *MultiStore) Set(key, value []byte)

func (*MultiStore) SetObj

func (ms *MultiStore) SetObj(key []byte, obj types.Serializable)

func (*MultiStore) SubStore

func (ms *MultiStore) SubStore(storeKey types.StoreKey) types.KObjStore

type PrefixedStore

type PrefixedStore struct {
	// contains filtered or unexported fields
}

func NewPrefixedStore

func NewPrefixedStore(parent *MultiStore, prefix []byte) PrefixedStore

func (PrefixedStore) Delete

func (s PrefixedStore) Delete(key []byte)

Implements KObjStore

func (PrefixedStore) Get

func (s PrefixedStore) Get(key []byte) []byte

Implements KObjStore

func (PrefixedStore) GetObj

func (s PrefixedStore) GetObj(key []byte, ptr *types.Serializable)

Implements KObjStore

func (PrefixedStore) GetReadOnlyObj

func (s PrefixedStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)

Implements KObjStore

func (PrefixedStore) Has

func (s PrefixedStore) Has(key []byte) bool

Implements KObjStore

func (PrefixedStore) Iterator

func (s PrefixedStore) Iterator(start, end []byte) types.ObjIterator

Implements KObjStore

func (PrefixedStore) ReverseIterator

func (s PrefixedStore) ReverseIterator(start, end []byte) types.ObjIterator

Implements KObjStore

func (PrefixedStore) Set

func (s PrefixedStore) Set(key, value []byte)

Implements KObjStore

func (PrefixedStore) SetObj

func (s PrefixedStore) SetObj(key []byte, obj types.Serializable)

Implements KObjStore

type RootStore

type RootStore struct {
	// contains filtered or unexported fields
}

func NewRootStore

func NewRootStore(okv *onvakv.OnvaKV, storeKeys map[types.StoreKey]struct{}, isCacheableKey func(k []byte) bool) *RootStore

func (*RootStore) ActiveCount

func (root *RootStore) ActiveCount() int

func (*RootStore) BeginWrite

func (root *RootStore) BeginWrite()

func (*RootStore) CheckConsistency

func (root *RootStore) CheckConsistency()

func (*RootStore) Close

func (root *RootStore) Close()

func (*RootStore) Delete

func (root *RootStore) Delete(key []byte)

func (*RootStore) EndWrite

func (root *RootStore) EndWrite()

func (*RootStore) Get

func (root *RootStore) Get(key []byte) []byte

func (*RootStore) GetObjCopy

func (root *RootStore) GetObjCopy(key []byte, ptr *types.Serializable)

func (*RootStore) GetReadOnlyObj

func (root *RootStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)

func (*RootStore) GetRootHash

func (root *RootStore) GetRootHash() []byte

func (*RootStore) GetTrunkStore

func (root *RootStore) GetTrunkStore() interface{}

func (*RootStore) Has

func (root *RootStore) Has(key []byte) bool

func (*RootStore) Iterator

func (root *RootStore) Iterator(start, end []byte) types.ObjIterator

func (*RootStore) PrepareForDeletion

func (root *RootStore) PrepareForDeletion(key []byte)

func (*RootStore) PrepareForUpdate

func (root *RootStore) PrepareForUpdate(key []byte)

func (*RootStore) ReverseIterator

func (root *RootStore) ReverseIterator(start, end []byte) types.ObjIterator

func (*RootStore) Set

func (root *RootStore) Set(key, value []byte)

func (*RootStore) SetHeight

func (root *RootStore) SetHeight(h int64)

func (*RootStore) SetObj

func (root *RootStore) SetObj(key []byte, obj types.Serializable)

type RootStoreIterator

type RootStoreIterator struct {
	// contains filtered or unexported fields
}

func (*RootStoreIterator) Close

func (iter *RootStoreIterator) Close()

func (*RootStoreIterator) Domain

func (iter *RootStoreIterator) Domain() (start []byte, end []byte)

func (*RootStoreIterator) Key

func (iter *RootStoreIterator) Key() (key []byte)

func (*RootStoreIterator) Next

func (iter *RootStoreIterator) Next()

func (*RootStoreIterator) ObjValue

func (iter *RootStoreIterator) ObjValue(ptr *types.Serializable)

func (*RootStoreIterator) Valid

func (iter *RootStoreIterator) Valid() bool

func (*RootStoreIterator) Value

func (iter *RootStoreIterator) Value() (value []byte)

type TrunkStore

type TrunkStore struct {
	// contains filtered or unexported fields
}

We use a new TrunkStore for every block

func (*TrunkStore) ActiveCount

func (ts *TrunkStore) ActiveCount() int

func (*TrunkStore) Cached

func (ts *TrunkStore) Cached() *MultiStore

func (*TrunkStore) Close

func (ts *TrunkStore) Close(writeBack bool)

func (*TrunkStore) Get

func (ts *TrunkStore) Get(key []byte) []byte

func (*TrunkStore) GetObjCopy

func (ts *TrunkStore) GetObjCopy(key []byte, ptr *types.Serializable)

func (*TrunkStore) GetReadOnlyObj

func (ts *TrunkStore) GetReadOnlyObj(key []byte, ptr *types.Serializable)

func (*TrunkStore) Has

func (ts *TrunkStore) Has(key []byte) bool

func (*TrunkStore) Iterator

func (ts *TrunkStore) Iterator(start, end []byte) types.ObjIterator

func (*TrunkStore) PrepareForDeletion

func (ts *TrunkStore) PrepareForDeletion(key []byte)

func (*TrunkStore) PrepareForUpdate

func (ts *TrunkStore) PrepareForUpdate(key []byte)

func (*TrunkStore) ReverseIterator

func (ts *TrunkStore) ReverseIterator(start, end []byte) types.ObjIterator

func (*TrunkStore) Update

func (ts *TrunkStore) Update(updator func(cache *CacheStore))

Directories

Path Synopsis
b

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL