Documentation ¶
Index ¶
Constants ¶
const ( INIT int = -1 CLOSED int = -2 )
Variables ¶
var ( ErrLSMTClosed = errors.New("[LSMT] lsmt is closed") ErrEmptyKey = errors.New("[LSMT] key must not be nil and must not be empty") ErrMaxKeySize = errors.New("[LSMT] key must not be greater than the maximum key size") ErrEmptyValue = errors.New("[LSMT] value must not be nil and must not not be empty") ErrMaxValueSize = errors.New("[LSMT] value must not be greater than the maximum value size") ErrKeyOutOfBounds = errors.New("[LSMT] one or more keys is out of the required bounds") )
var Tombstone = []byte{}
Tombstone represents a "deleted" key
Functions ¶
func NewMergedIterator ¶
NewMergedIterator creates a new merged iterator from the given slice of iterators. The iterators are expected to be passed in priority order, meaning that if two or more iterators contain the same key then accept the pair from the iterator at the smaller index. Each key will only be returned once from a merged iterator and it is assumed that each key only appears once in each provided iterator.
Accepts a returnTombstone parameter which indicates whether to return pairs with a tombstone value.
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
func NewBloomFilter ¶
func NewBloomFilter(size uint32) *BloomFilter
NewBloomFilter creates a new instance of a BloomFilter. Accepts the size, in bytes, of the bitfield as well as the number of hashing functions to use. The number of hashing functions must be either 1 or 2.
func (*BloomFilter) Insert ¶
func (bf *BloomFilter) Insert(bytes []byte)
Insert inserts a new entry into the set of entries.
func (*BloomFilter) Test ¶
func (bf *BloomFilter) Test(bytes []byte) bool
Test tests whether an entry exists within the set of entries. The return value is probabilistic and only indicates whether an entry is definitively not present (false) or may be present (true).
type Iterator ¶
Iterator describes an interator interface and allows for the sequential movement through ordered data structures. The Next() method must always be called before Get(). If Next() returns false then there are no more values to Get() and Close() should be invoked.
type Semaphore ¶
type Semaphore chan placeholder
func NewSemaphore ¶
NewSemaphore creates a new semaphore allowing for a fixed size of locks.
func (Semaphore) IsLocked ¶
IsLocked returns true if the semaphore is fully locked, false if there are still slots available