Documentation ¶
Index ¶
- Constants
- Variables
- func CompareGet(iter Iterator, key, value []byte, t *testing.T)
- func CompareNext(iter Iterator, expected bool, t *testing.T)
- func EmptyIterator() *emptyIterator
- func NewMergedIterator(iterators []Iterator, returnTombstone bool) *mergedIterator
- func SetUp(t *testing.T)
- func TearDown(t *testing.T)
- type BloomFilter
- type Iterator
- type Pair
- type Semaphore
Constants ¶
const ( INIT int = -1 CLOSED int = -2 )
const TEST_DIR string = "/tmp/lsmt/"
Variables ¶
var ( ERR_LSMT_CLOSED = errors.New("lsmt is closed") ERR_ITER_CLOSED = errors.New("iterator is closed") ERR_KEY_NIL_OR_EMPTY = errors.New("key must not be nil and must not be empty") ERR_VAL_NIL_OR_EMPTY = errors.New("value must not be nil and must not be empty") ERR_KEY_TOO_LARGE = errors.New("key must not be greater than the maximum key size") ERR_VAL_TOO_LARGE = errors.New("value must not be greater than the maximum value size") ERR_START_NIL_OR_EMPTY = errors.New("start must not be nil and must not be empty") ERR_END_NIL_OR_EMPTY = errors.New("end must not be nil and must not be empty") ERR_START_GREATER_THAN_END = errors.New("start must be less than end") ERR_NIL_ITERATOR = errors.New("unable to flush nil iterator") ERR_ITER_GET_INVOKED_ON_INIT = errors.New("Get() invoked before Next()") ERR_BLOCK_UNDERFLOW = errors.New("unable to read all used bytes for in block") )
var EMPTY_LEVELS []*config.Level = []*config.Level{}
var SINGLETON *emptyIterator = &emptyIterator{}
var Tombstone = []byte{}
Tombstones are values used to represent a deleted key
Functions ¶
func EmptyIterator ¶
func EmptyIterator() *emptyIterator
func 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
Creates a new instance of a BloomFilter. Accepts the size, in bytes, of the bitfield.
func (*BloomFilter) Insert ¶
func (bf *BloomFilter) Insert(bytes []byte)
Insert a new entry into the set of entries.
func (*BloomFilter) Test ¶
func (bf *BloomFilter) Test(bytes []byte) bool
Test 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 ¶
Iterators allow for the sequential movement through ordered data structures Next() 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 ¶
Creates a new semaphore allowing for a fixed size of locks.
func (Semaphore) IsLocked ¶
Returns true if the semaphore is fully locked, false if there are still slots available