Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOptions ¶
DefaultOptions returns the default options of pebble kv store. ref: https://github.com/cockroachdb/cockroach/blob/master/pkg/storage/pebble.go#L445-L498
Types ¶
type IDStore ¶
type IDStore interface { io.Closer // Get returns the value by given key, if not exist return false. Get(key []byte) ([]byte, bool, error) // Put puts the value into store by given key. Put(key, val []byte) error // Merge puts the value into store by given key, if the key exist, will merge value in background. Merge(key, val []byte) error // Delete deletes the value by given key. Delete(key []byte) error // IterKeys iterates the key list by given prefix, returns the key list. IterKeys(prefix []byte, limit int) (rs [][]byte, err error) // Flush flushes the memory table data under pebble db. Flush() error }
IDStore represents unique id store for LinDB's metadata.
func NewIDStore ¶
NewIDStore creates an IDStore instance.
type Sequence ¶
type Sequence interface { // HasNext checks if it has sequence in cache. HasNext() bool // Next returns next sequence from cache. Next() uint32 // Current returns current sequence from cache. Current() uint32 // Limit sets new limit value. Limit(limit uint32) }
Sequence represents allocate sequence with batch cache, reduces write operations. NOTICE: not thread safe.
func NewSequence ¶
NewSequence creates a Sequence instance.
Click to show internal directories.
Click to hide internal directories.