bytetree

package
v0.0.0-...-df46cc1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package bytetree provides a Radix tree that stores []byte keys and values. See https://en.wikipedia.org/wiki/Radix_tree

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tree

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

func New

func New(
	outExprs []expr.Expr,
	inExprs []expr.Expr,
	outResolution time.Duration,
	inResolution time.Duration,
	asOf time.Time,
	until time.Time,
	strideSlice time.Duration,
) *Tree

New constructs a new Tree.

func (*Tree) Bytes

func (bt *Tree) Bytes() int

Bytes returns an estimate of the number of bytes stored in this Tree.

func (*Tree) Copy

func (bt *Tree) Copy() *Tree

Copy makes a copy of this Tree.

func (*Tree) Length

func (bt *Tree) Length() int

Length returns the number of nodes in this Tree.

func (*Tree) Remove

func (bt *Tree) Remove(ctx int64, fullKey []byte) []encoding.Sequence

Remove removes the given key from this Tree under the given ctx. When viewed from this ctx, the key will appear to be gone, but from other contexts it will remain visible.

func (*Tree) Update

func (bt *Tree) Update(key []byte, vals []encoding.Sequence, params encoding.TSParams, metadata bytemap.ByteMap) int

Update updates all of the fields at the given timestamp with the given parameters.

func (*Tree) Walk

func (bt *Tree) Walk(ctx int64, fn func(key []byte, data []encoding.Sequence) (more bool, keep bool, err error)) error

Walk walks this Tree, calling the given fn with each node's key and data. If the fn returns false, the node will be removed from the Tree as viewed with the given ctx. Subsequent walks of the Tree using that same ctx will not see removed nodes, but walks using a different context will still see them.

Jump to

Keyboard shortcuts

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