engineccl

package
v0.0.0-...-69190e3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: Apache-2.0 Imports: 8 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.

Jump to

Keyboard shortcuts

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