Documentation ¶
Index ¶
- Constants
- Variables
- func CreateBranch(ctx context.Context, poolConfig *pools.Config, engine storage.Engine, ...) (*branches.Config, error)
- func CreatePool(ctx context.Context, config *pools.Config, engine storage.Engine, ...) error
- func DataPath(poolPath *storage.URI) *storage.URI
- func IndexPath(poolPath *storage.URI) *storage.URI
- func RemovePool(ctx context.Context, config *pools.Config, engine storage.Engine, ...) error
- func ScanIndexes(ctx context.Context, snap commits.View, span extent.Span, o order.Which, ...) error
- func ScanPartitions(ctx context.Context, snap commits.View, span extent.Span, o order.Which, ...) error
- func ScanSpan(ctx context.Context, snap commits.View, span extent.Span, o order.Which, ...) error
- func ScanSpanInOrder(ctx context.Context, snap commits.View, span extent.Span, o order.Which, ...) error
- type Branch
- func (b *Branch) ApplyIndexRules(ctx context.Context, rules []index.Rule, ids []ksuid.KSUID) (ksuid.KSUID, error)
- func (b *Branch) Delete(ctx context.Context, ids []ksuid.KSUID, author, message string) (ksuid.KSUID, error)
- func (b *Branch) Load(ctx context.Context, zctx *zed.Context, r zio.Reader, ...) (ksuid.KSUID, error)
- func (b *Branch) LookupTags(ctx context.Context, tags []ksuid.KSUID) ([]ksuid.KSUID, error)
- func (b *Branch) Pool() *Pool
- func (b *Branch) Revert(ctx context.Context, commit ksuid.KSUID, author, message string) (ksuid.KSUID, error)
- func (b *Branch) Stats(ctx context.Context, snap commits.View) (info BranchStats, err error)
- func (b *Branch) UpdateIndex(ctx context.Context, rules []index.Rule) (ksuid.KSUID, error)
- type BranchMeta
- type BranchStats
- type BranchTip
- type ImportStats
- type LakeMagic
- type Partition
- type Pool
- func (p *Pool) ListBranches(ctx context.Context) ([]branches.Config, error)
- func (p *Pool) LookupBranchByName(ctx context.Context, name string) (*branches.Config, error)
- func (p *Pool) Main(ctx context.Context) (BranchMeta, error)
- func (p *Pool) ObjectExists(ctx context.Context, id ksuid.KSUID) (bool, error)
- func (p *Pool) OpenBranchByName(ctx context.Context, name string) (*Branch, error)
- func (p *Pool) Snapshot(ctx context.Context, commit ksuid.KSUID) (commits.View, error)
- func (p *Pool) Stats(ctx context.Context, snap commits.View) (info PoolStats, err error)
- type PoolStats
- type Root
- func (r *Root) AddIndexRules(ctx context.Context, rules []index.Rule) error
- func (r *Root) AllIndexRules(ctx context.Context) ([]index.Rule, error)
- func (r *Root) CommitObject(ctx context.Context, poolID ksuid.KSUID, branchName string) (ksuid.KSUID, error)
- func (r *Root) CreateBranch(ctx context.Context, poolID ksuid.KSUID, name string, parent ksuid.KSUID) (*branches.Config, error)
- func (r *Root) CreatePool(ctx context.Context, name string, layout order.Layout, seekStride int, ...) (*Pool, error)
- func (r *Root) DeleteIndexRules(ctx context.Context, ids []ksuid.KSUID) ([]index.Rule, error)
- func (r *Root) Layout(ctx context.Context, src dag.Source) order.Layout
- func (r *Root) ListPools(ctx context.Context) ([]pools.Config, error)
- func (r *Root) LookupIndexRules(ctx context.Context, names ...string) ([]index.Rule, error)
- func (r *Root) MergeBranch(ctx context.Context, poolID ksuid.KSUID, ...) (ksuid.KSUID, error)
- func (r *Root) NewScheduler(ctx context.Context, zctx *zed.Context, src dag.Source, span extent.Span, ...) (op.Scheduler, error)
- func (r *Root) Open(context.Context, *zed.Context, string, zbuf.Filter) (zbuf.Puller, error)
- func (r *Root) OpenPool(ctx context.Context, id ksuid.KSUID) (*Pool, error)
- func (r *Root) PoolID(ctx context.Context, poolName string) (ksuid.KSUID, error)
- func (r *Root) RemoveBranch(ctx context.Context, poolID ksuid.KSUID, name string) error
- func (r *Root) RemovePool(ctx context.Context, id ksuid.KSUID) error
- func (r *Root) RenamePool(ctx context.Context, id ksuid.KSUID, newName string) error
- func (r *Root) Revert(ctx context.Context, poolID ksuid.KSUID, branchName string, ...) (ksuid.KSUID, error)
- type Scheduler
- type Writer
Constants ¶
const ( DataTag = "data" IndexTag = "index" BranchesTag = "branches" CommitsTag = "commits" )
const ( Version = 1 PoolsTag = "pools" IndexRulesTag = "index_rules" LakeMagicFile = "lake.zng" LakeMagicString = "ZED LAKE" )
Variables ¶
var ( ErrCommitFailed = fmt.Errorf("exceeded max update attempts (%d) to branch tip: commit failed", maxCommitRetries) ErrInvalidCommitMeta = errors.New("cannot parse ZSON string") )
Functions ¶
func CreateBranch ¶
func CreatePool ¶
func RemovePool ¶
func ScanIndexes ¶
func ScanPartitions ¶
func ScanPartitions(ctx context.Context, snap commits.View, span extent.Span, o order.Which, ch chan<- Partition) error
ScanPartitions partitions all the data objects in snap overlapping span into non-overlapping partitions, sorts them by pool key and order, and sends them to ch.
Types ¶
type Branch ¶
func OpenBranch ¶
func (*Branch) ApplyIndexRules ¶
func (*Branch) LookupTags ¶
type BranchMeta ¶
type BranchStats ¶
type ImportStats ¶
func (*ImportStats) Accumulate ¶
func (s *ImportStats) Accumulate(b ImportStats)
func (*ImportStats) Copy ¶
func (s *ImportStats) Copy() ImportStats
type Partition ¶
type Partition struct { extent.Span Objects []*data.ObjectScan // contains filtered or unexported fields }
A Partition is a logical view of the records within a time span, stored in one or more data objects. This provides a way to return the list of objects that should be scanned along with a span to limit the scan to only the span involved.
func PartitionObjects ¶
PartitionObjects takes a sorted set of data objects with possibly overlapping key ranges and returns an ordered list of Ranges such that none of the Ranges overlap with one another. This is the straightforward computational geometry problem of merging overlapping intervals, e.g., https://www.geeksforgeeks.org/merging-intervals/
XXX this algorithm doesn't quite do what we want because it continues to merge *anything* that overlaps. It's easy to fix though. Issue #2538
func (Partition) FormatRange ¶
func (Partition) FormatRangeOf ¶
type Pool ¶
type Pool struct { pools.Config Path *storage.URI DataPath *storage.URI IndexPath *storage.URI // contains filtered or unexported fields }
func (*Pool) ListBranches ¶
func (*Pool) LookupBranchByName ¶
func (*Pool) ObjectExists ¶
XXX this is inefficient but is only meant for interactive queries...?
func (*Pool) OpenBranchByName ¶
type PoolStats ¶
type PoolStats struct { Size int64 `zed:"size"` // XXX (nibs) - This shouldn't be a span because keys don't have to be time. Span *nano.Span `zed:"span"` }
XXX for backward compat keep this for now, and return branchstats for pool/main
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
The Root of the lake represents the path prefix and configuration state for all of the data pools in the lake.
func CreateOrOpen ¶
func (*Root) AddIndexRules ¶
func (*Root) AllIndexRules ¶
func (*Root) CommitObject ¶
func (*Root) CreateBranch ¶
func (*Root) CreatePool ¶
func (*Root) DeleteIndexRules ¶
func (*Root) LookupIndexRules ¶
func (*Root) MergeBranch ¶
func (r *Root) MergeBranch(ctx context.Context, poolID ksuid.KSUID, childBranch, parentBranch, author, message string) (ksuid.KSUID, error)
MergeBranch merges the indicated branch into its parent returning the commit tag of the new commit into the parent branch.
func (*Root) NewScheduler ¶
func (*Root) RemoveBranch ¶
func (*Root) RemovePool ¶
RemovePool deletes a pool from the configuration journal and deletes all data associated with the pool.
func (*Root) RenamePool ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewSortedScheduler ¶
func (*Scheduler) AddProgress ¶ added in v1.0.0
func (*Scheduler) PullScanWork ¶
PullScanWork returns the next span in the schedule. This is useful for a worker proc that pulls spans from teh scheduler, sends them to a remote worker, and streams the results into the runtime DAG.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a zio.Writer that consumes records into memory according to the pools data object threshold, sorts each resulting buffer, and writes it as an immutable object to the storage system. The presumption is that each buffer's worth of data fits into memory.
func NewWriter ¶
NewWriter creates a zio.Writer compliant writer for writing data to an a data pool presuming the input is not guaranteed to be sorted. XXX we should make another writer that takes sorted input and is a bit more efficient. This other writer could have different commit triggers to do useful things like paritioning given the context is a rollup.
func (*Writer) Stats ¶
func (w *Writer) Stats() ImportStats