Documentation ¶
Index ¶
- Variables
- type MemStore
- func (m *MemStore) Add(key []byte, value []byte) error
- func (m *MemStore) Contains(key []byte) bool
- func (m *MemStore) Delete(key []byte) error
- func (m *MemStore) DeleteIfExists(key []byte) error
- func (m *MemStore) EstimatedSizeInBytes() uint64
- func (m *MemStore) Flush(writerOptions ...sstables.WriterOption) error
- func (m *MemStore) FlushWithTombstones(writerOptions ...sstables.WriterOption) error
- func (m *MemStore) Get(key []byte) ([]byte, error)
- func (m *MemStore) SStableIterator() sstables.SSTableIteratorI
- func (m *MemStore) Size() int
- func (m *MemStore) Tombstone(key []byte) error
- func (m *MemStore) Upsert(key []byte, value []byte) error
- type MemStoreI
- type SkipListSStableIterator
- type ValueStruct
Constants ¶
This section is empty.
Variables ¶
View Source
var KeyAlreadyExists = errors.New("key already exists")
View Source
var KeyNil = errors.New("key was nil")
View Source
var KeyNotFound = errors.New("key not found")
View Source
var KeyTombstoned = errors.New("key was tombstoned")
View Source
var ValueNil = errors.New("value was nil")
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
func (*MemStore) DeleteIfExists ¶
func (*MemStore) EstimatedSizeInBytes ¶
func (*MemStore) FlushWithTombstones ¶ added in v1.3.0
func (m *MemStore) FlushWithTombstones(writerOptions ...sstables.WriterOption) error
func (*MemStore) SStableIterator ¶ added in v1.3.0
func (m *MemStore) SStableIterator() sstables.SSTableIteratorI
type MemStoreI ¶
type MemStoreI interface { // Add inserts when the key does not exist yet, returns a KeyAlreadyExists error when the key exists. // Neither nil key nor values are allowed, KeyNil and ValueNil will be returned accordingly. Add(key []byte, value []byte) error // Contains returns true when the given key exists, false otherwise Contains(key []byte) bool // Get returns the values for the given key, if not exists returns a KeyNotFound error // if the key exists (meaning it was added and deleted) it will return KeyTombstoned as an error Get(key []byte) ([]byte, error) // Upsert inserts when the key does not exist yet, updates the current value if the key exists. // Neither nil key nor values are allowed, KeyNil and ValueNil will be returned accordingly. Upsert(key []byte, value []byte) error // Delete deletes the key from the MemStore, returns a KeyNotFound error if the key does not exist. // Effectively this will set a tombstone for the given key and set its value to be nil. Delete(key []byte) error // DeleteIfExists deletes the key from the MemStore. The semantic is the same as in Delete, however when there is no // key in the memstore it will also not set a tombstone for it and there will be no error when the key isn't there. // That can be problematic in several database constellation, where you can use Tombstone. DeleteIfExists(key []byte) error // Tombstone records the given key as if it were deleted. When a given key does not exist it will insert it, // when it does it will do a Delete Tombstone(key []byte) error // EstimatedSizeInBytes returns a rough estimate of size in bytes of this MemStore EstimatedSizeInBytes() uint64 // Flush flushes the current memstore to disk as an SSTable, error if unsuccessful. This excludes tombstoned keys. Flush(opts ...sstables.WriterOption) error // FlushWithTombstones flushes the current memstore to disk as an SSTable, error if unsuccessful. // This includes tombstoned keys and writes their values as nil. FlushWithTombstones(opts ...sstables.WriterOption) error // SStableIterator returns the current memstore as an sstables.SStableIteratorI to iterate the table in memory. // if there is a tombstoned record, the key will be returned but the value will be nil. // this is especially useful when you want to merge on-disk sstables with in memory memstores SStableIterator() sstables.SSTableIteratorI // Size Returns how many elements are in this memstore. This also includes tombstoned keys. Size() int }
noinspection GoNameStartsWithPackageName
func NewMemStore ¶
func NewMemStore() MemStoreI
type SkipListSStableIterator ¶ added in v1.3.0
type SkipListSStableIterator struct {
// contains filtered or unexported fields
}
type ValueStruct ¶
type ValueStruct struct {
// contains filtered or unexported fields
}
func (ValueStruct) GetValue ¶
func (v ValueStruct) GetValue() []byte
Click to show internal directories.
Click to hide internal directories.