engineccl

package
v0.0.0-...-a358892 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyBatchRepr

func VerifyBatchRepr(
	repr []byte, start, end engine.MVCCKey, nowNanos int64,
) (enginepb.MVCCStats, error)

VerifyBatchRepr asserts that all keys in a BatchRepr are between the specified start and end keys and computes the enginepb.MVCCStats for it.

Types

type MVCCIncrementalIterator

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

MVCCIncrementalIterator iterates over the diff of the key range [startKey,endKey) and time range [startTime,endTime). If a key was added or modified between startTime and endTime, the iterator will position at the most recent version (before endTime) of that key. If the key was most recently deleted, this is signalled with an empty value.

Expected usage:

iter := NewMVCCIncrementalIterator(e)
defer iter.Close()
for iter.Reset(startKey, endKey, ...); iter.Valid(); iter.Next() {
    [code using iter.Key() and iter.Value()]
}
if err := iter.Error(); err != nil {
  ...
}

func NewMVCCIncrementalIterator

func NewMVCCIncrementalIterator(e engine.Reader) *MVCCIncrementalIterator

NewMVCCIncrementalIterator creates an MVCCIncrementalIterator with the specified engine.

func (*MVCCIncrementalIterator) Close

func (i *MVCCIncrementalIterator) Close()

Close frees up resources held by the iterator.

func (*MVCCIncrementalIterator) Error

func (i *MVCCIncrementalIterator) Error() error

Error returns the error, if any, which the iterator encountered.

func (*MVCCIncrementalIterator) Key

Key returns the current key.

func (*MVCCIncrementalIterator) Next

func (i *MVCCIncrementalIterator) Next()

Next advances the iterator to the next key/value in the iteration.

func (*MVCCIncrementalIterator) Reset

func (i *MVCCIncrementalIterator) Reset(
	startKey, endKey roachpb.Key, startTime, endTime hlc.Timestamp,
)

Reset begins a new iteration with the specified key and time ranges.

func (*MVCCIncrementalIterator) Valid

func (i *MVCCIncrementalIterator) Valid() bool

Valid returns true if the iterator is currently valid. An iterator that hasn't had Reset called on it or has gone past the end of the key range is invalid.

func (*MVCCIncrementalIterator) Value

func (i *MVCCIncrementalIterator) Value() []byte

Value returns the current value as a byte slice.

type MultiIterator

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

MultiIterator multiplexes iteration over a number of engine.Iterators.

func MakeMultiIterator

func MakeMultiIterator(iters []engine.Iterator) *MultiIterator

MakeMultiIterator creates an iterator that multiplexes engine.Iterators.

func (*MultiIterator) Error

func (f *MultiIterator) Error() error

Error returns the error, if any, which the iterator encountered.

func (*MultiIterator) Next

func (f *MultiIterator) Next()

Next advances the iterator to the next key/value in the iteration. After this call, Valid() will be true if the iterator was not positioned at the last key.

func (*MultiIterator) NextKey

func (f *MultiIterator) NextKey()

NextKey advances the iterator to the next MVCC key. This operation is distinct from Next which advances to the next version of the current key or the next key if the iterator is currently located at the last version for a key.

func (*MultiIterator) Seek

func (f *MultiIterator) Seek(key engine.MVCCKey)

Seek advances the iterator to the first key in the engine which is >= the provided key.

func (*MultiIterator) UnsafeKey

func (f *MultiIterator) UnsafeKey() engine.MVCCKey

UnsafeKey returns the current key, but the memory is invalidated on the next call to {NextKey,Seek}.

func (*MultiIterator) UnsafeValue

func (f *MultiIterator) UnsafeValue() []byte

UnsafeValue returns the current value as a byte slice, but the memory is invalidated on the next call to {NextKey,Seek}.

func (*MultiIterator) Valid

func (f *MultiIterator) Valid() bool

Valid returns true if the iterator is currently valid. An iterator that hasn't had Seek called on it or has gone past the end of the key range is invalid.

Jump to

Keyboard shortcuts

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