Documentation ¶
Index ¶
- func ChunkStoreFromVRW(vrw types.ValueReadWriter) chunks.ChunkStore
- func ConflictDebugFormat(ctx context.Context, m ConflictMap) (string, error)
- func DebugFormat(ctx context.Context, m Map) (string, error)
- func DiffMaps(ctx context.Context, from, to Map, cb DiffFn) error
- func KeyDescriptorFromSchema(sch schema.Schema) val.TupleDesc
- func MapDescriptorsFromScheam(sch schema.Schema) (kd, vd val.TupleDesc)
- func NodeFromValue(v types.Value) tree.Node
- func ValueDescriptorFromSchema(sch schema.Schema) val.TupleDesc
- func ValueFromConflictMap(m ConflictMap) types.Value
- func ValueFromMap(m Map) types.Value
- type AddressMap
- func (c AddressMap) Count() int
- func (c AddressMap) Editor() AddressMapEditor
- func (c AddressMap) Format() *types.NomsBinFormat
- func (c AddressMap) Get(ctx context.Context, name string) (addr hash.Hash, err error)
- func (c AddressMap) Has(ctx context.Context, name string) (ok bool, err error)
- func (c AddressMap) HashOf() hash.Hash
- func (c AddressMap) Height() int
- func (c AddressMap) IterAll(ctx context.Context, cb func(name string, address hash.Hash) error) error
- func (c AddressMap) WalkAddresses(ctx context.Context, cb tree.AddressCb) error
- func (c AddressMap) WalkNodes(ctx context.Context, cb tree.NodeCb) error
- type AddressMapEditor
- func (wr AddressMapEditor) Add(ctx context.Context, name string, addr hash.Hash) error
- func (wr AddressMapEditor) Delete(ctx context.Context, name string) error
- func (wr AddressMapEditor) Flush(ctx context.Context) (AddressMap, error)
- func (wr AddressMapEditor) Update(ctx context.Context, name string, addr hash.Hash) error
- type Conflict
- type ConflictEditor
- type ConflictIter
- type ConflictMap
- func ConflictMapFromValue(v types.Value, ourSchema, theirSchema, baseSchema schema.Schema, ...) ConflictMap
- func NewConflictMap(root tree.Node, ns tree.NodeStore, key, ours, theirs, base val.TupleDesc) ConflictMap
- func NewEmptyConflictMap(ns tree.NodeStore, key, ours, theirs, base val.TupleDesc) ConflictMap
- func (c ConflictMap) Count() int
- func (c ConflictMap) Descriptors() (key, ours, theirs, base val.TupleDesc)
- func (c ConflictMap) Editor() ConflictEditor
- func (c ConflictMap) Format() *types.NomsBinFormat
- func (c ConflictMap) Get(ctx context.Context, key val.Tuple, cb KeyValueFn[val.Tuple, Conflict]) (err error)
- func (c ConflictMap) Has(ctx context.Context, key val.Tuple) (ok bool, err error)
- func (c ConflictMap) HashOf() hash.Hash
- func (c ConflictMap) Height() int
- func (c ConflictMap) IterAll(ctx context.Context) (ConflictIter, error)
- func (c ConflictMap) IterOrdinalRange(ctx context.Context, start, stop uint64) (ConflictIter, error)
- func (c ConflictMap) WalkAddresses(ctx context.Context, cb tree.AddressCb) error
- func (c ConflictMap) WalkNodes(ctx context.Context, cb tree.NodeCb) error
- type DiffFn
- type KeyValueFn
- type Map
- func MapFromValue(v types.Value, sch schema.Schema, vrw types.ValueReadWriter) Map
- func MergeMaps(ctx context.Context, left, right, base Map, cb tree.CollisionFn) (Map, error)
- func NewMap(node tree.Node, ns tree.NodeStore, keyDesc, valDesc val.TupleDesc) Map
- func NewMapFromTuples(ctx context.Context, ns tree.NodeStore, keyDesc, valDesc val.TupleDesc, ...) (Map, error)
- func (m Map) Count() int
- func (m Map) Descriptors() (val.TupleDesc, val.TupleDesc)
- func (m Map) Format() *types.NomsBinFormat
- func (m Map) Get(ctx context.Context, key val.Tuple, cb KeyValueFn[val.Tuple, val.Tuple]) (err error)
- func (m Map) Has(ctx context.Context, key val.Tuple) (ok bool, err error)
- func (m Map) HashOf() hash.Hash
- func (m Map) Height() int
- func (m Map) IterAll(ctx context.Context) (MapIter, error)
- func (m Map) IterOrdinalRange(ctx context.Context, start, stop uint64) (MapIter, error)
- func (m Map) IterRange(ctx context.Context, rng Range) (MapIter, error)
- func (m Map) Last(ctx context.Context) (key, value val.Tuple, err error)
- func (m Map) Mutate() MutableMap
- func (m Map) Pool() pool.BuffPool
- func (m Map) WalkAddresses(ctx context.Context, cb tree.AddressCb) error
- func (m Map) WalkNodes(ctx context.Context, cb tree.NodeCb) error
- type MapIter
- type MutableMap
- func (mut *MutableMap) ApplyPending(ctx context.Context) error
- func (mut MutableMap) Delete(ctx context.Context, key val.Tuple) error
- func (mut *MutableMap) DiscardPending(context.Context)
- func (mut MutableMap) Get(ctx context.Context, key val.Tuple, cb KeyValueFn[val.Tuple, val.Tuple]) (err error)
- func (mut MutableMap) Has(ctx context.Context, key val.Tuple) (ok bool, err error)
- func (mut MutableMap) HasEdits() bool
- func (mut MutableMap) IterAll(ctx context.Context) (MapIter, error)
- func (mut MutableMap) IterRange(ctx context.Context, rng Range) (MapIter, error)
- func (mut MutableMap) Map(ctx context.Context) (Map, error)
- func (mut MutableMap) Put(ctx context.Context, key, value val.Tuple) error
- type Range
- func ClosedRange(start, stop val.Tuple, desc val.TupleDesc) Range
- func GreaterOrEqualRange(start val.Tuple, desc val.TupleDesc) Range
- func GreaterRange(start val.Tuple, desc val.TupleDesc) Range
- func LesserOrEqualRange(stop val.Tuple, desc val.TupleDesc) Range
- func LesserRange(stop val.Tuple, desc val.TupleDesc) Range
- func MergeOverlappingRanges(ranges ...Range) (merged []Range)
- func OpenRange(start, stop val.Tuple, desc val.TupleDesc) Range
- func OpenStartRange(start, stop val.Tuple, desc val.TupleDesc) Range
- func OpenStopRange(start, stop val.Tuple, desc val.TupleDesc) Range
- func SortRanges(ranges ...Range) []Range
- type RangeCut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkStoreFromVRW ¶
func ChunkStoreFromVRW(vrw types.ValueReadWriter) chunks.ChunkStore
func ConflictDebugFormat ¶
func ConflictDebugFormat(ctx context.Context, m ConflictMap) (string, error)
ConflictDebugFormat formats a ConflictMap.
func DebugFormat ¶
DebugFormat formats a Map.
func ValueFromConflictMap ¶
func ValueFromConflictMap(m ConflictMap) types.Value
func ValueFromMap ¶
Types ¶
type AddressMap ¶
type AddressMap struct {
// contains filtered or unexported fields
}
func NewEmptyAddressMap ¶
func NewEmptyAddressMap(ns tree.NodeStore) AddressMap
func (AddressMap) Count ¶
func (c AddressMap) Count() int
func (AddressMap) Editor ¶
func (c AddressMap) Editor() AddressMapEditor
func (AddressMap) Format ¶
func (c AddressMap) Format() *types.NomsBinFormat
func (AddressMap) HashOf ¶
func (c AddressMap) HashOf() hash.Hash
func (AddressMap) Height ¶
func (c AddressMap) Height() int
func (AddressMap) WalkAddresses ¶
type AddressMapEditor ¶
type AddressMapEditor struct {
// contains filtered or unexported fields
}
func (AddressMapEditor) Delete ¶
func (wr AddressMapEditor) Delete(ctx context.Context, name string) error
func (AddressMapEditor) Flush ¶
func (wr AddressMapEditor) Flush(ctx context.Context) (AddressMap, error)
type Conflict ¶
func (Conflict) TheirValue ¶
type ConflictEditor ¶
type ConflictEditor struct {
// contains filtered or unexported fields
}
func (ConflictEditor) Flush ¶
func (wr ConflictEditor) Flush(ctx context.Context) (ConflictMap, error)
type ConflictIter ¶
type ConflictMap ¶
type ConflictMap struct {
// contains filtered or unexported fields
}
func ConflictMapFromValue ¶
func ConflictMapFromValue(v types.Value, ourSchema, theirSchema, baseSchema schema.Schema, vrw types.ValueReadWriter) ConflictMap
func NewConflictMap ¶
func NewEmptyConflictMap ¶
func NewEmptyConflictMap(ns tree.NodeStore, key, ours, theirs, base val.TupleDesc) ConflictMap
func (ConflictMap) Count ¶
func (c ConflictMap) Count() int
func (ConflictMap) Descriptors ¶
func (c ConflictMap) Descriptors() (key, ours, theirs, base val.TupleDesc)
func (ConflictMap) Editor ¶
func (c ConflictMap) Editor() ConflictEditor
func (ConflictMap) Format ¶
func (c ConflictMap) Format() *types.NomsBinFormat
func (ConflictMap) Get ¶
func (c ConflictMap) Get(ctx context.Context, key val.Tuple, cb KeyValueFn[val.Tuple, Conflict]) (err error)
func (ConflictMap) HashOf ¶
func (c ConflictMap) HashOf() hash.Hash
func (ConflictMap) Height ¶
func (c ConflictMap) Height() int
func (ConflictMap) IterAll ¶
func (c ConflictMap) IterAll(ctx context.Context) (ConflictIter, error)
func (ConflictMap) IterOrdinalRange ¶
func (c ConflictMap) IterOrdinalRange(ctx context.Context, start, stop uint64) (ConflictIter, error)
func (ConflictMap) WalkAddresses ¶
type KeyValueFn ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func MapFromValue ¶
func NewMapFromTuples ¶
func NewMapFromTuples(ctx context.Context, ns tree.NodeStore, keyDesc, valDesc val.TupleDesc, tups ...val.Tuple) (Map, error)
NewMapFromTuples creates a prolly tree Map from slice of sorted Tuples.
func (Map) Descriptors ¶
Descriptors returns the TupleDesc's from this Map.
func (Map) Format ¶
func (m Map) Format() *types.NomsBinFormat
Format returns the NomsBinFormat of this Map.
func (Map) Get ¶
func (m Map) Get(ctx context.Context, key val.Tuple, cb KeyValueFn[val.Tuple, val.Tuple]) (err error)
Get searches for the key-value pair keyed by |key| and passes the results to the callback. If |key| is not present in the map, a nil key-value pair are passed.
func (Map) IterOrdinalRange ¶
IterOrdinalRange returns a MapIter for the ordinal range beginning at |start| and ending before |stop|.
type MutableMap ¶
type MutableMap struct {
// contains filtered or unexported fields
}
MutableMap represents a Map that is able to store mutations in-memory. A MutableMap has two tiers of in-memory storage: pending and applied. All mutations are first written to the pending tier, which may be discarded at any time. However, once ApplyPending() is called, those mutations are moved to the applied tier, and the pending tier is cleared.
func (*MutableMap) ApplyPending ¶
func (mut *MutableMap) ApplyPending(ctx context.Context) error
ApplyPending moves all pending mutations to the underlying map.
func (*MutableMap) DiscardPending ¶
func (mut *MutableMap) DiscardPending(context.Context)
DiscardPending removes all pending mutations.
func (MutableMap) Get ¶
func (mut MutableMap) Get(ctx context.Context, key val.Tuple, cb KeyValueFn[val.Tuple, val.Tuple]) (err error)
Get fetches the Tuple pair keyed by |key|, if it exists, and passes it to |cb|. If the |key| is not present in the MutableMap, a nil Tuple pair is passed to |cb|.
func (MutableMap) HasEdits ¶
func (mut MutableMap) HasEdits() bool
HasEdits returns true when the MutableMap has performed at least one Put or Delete operation. This does not indicate whether the materialized map contains different values to the contained unedited map.
func (MutableMap) IterAll ¶
func (mut MutableMap) IterAll(ctx context.Context) (MapIter, error)
IterAll returns a mutableMapIter that iterates over the entire MutableMap.
type Range ¶
Range defines a contiguous set of Tuples bounded by RangeCut predicates. Tuples satisfying all predicates must be included in the Range, but not all Tuples within a Range will satisfy all predicates.
func ClosedRange ¶
ClosedRange defines an inclusive Range of Tuples from |start| to |stop|.
func GreaterOrEqualRange ¶
GreaterOrEqualRange defines a Range of Tuples greater than or equal to |start|.
func GreaterRange ¶
GreaterRange defines a Range of Tuples greater than |start|.
func LesserOrEqualRange ¶
LesserOrEqualRange defines a Range of Tuples less than or equal to |stop|.
func LesserRange ¶
LesserRange defines a Range of Tuples less than |stop|.
func MergeOverlappingRanges ¶
MergeOverlappingRanges merges overlapping ranges.
func OpenStartRange ¶
OpenStartRange defines a half-open Range of Tuples from |start| to |stop|.
func OpenStopRange ¶
OpenStopRange defines a half-open Range of Tuples from |start| to |stop|.
func (Range) AboveStart ¶
AboveStart returns true if |t| is a member of |r|.