op

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BatchLen = 100

Variables

This section is empty.

Functions

func NewApplier

func NewApplier(octx *Context, parent zbuf.Puller, expr expr.Evaluator) *applier

func Unwrap

func Unwrap(batch zbuf.Batch) (zbuf.Batch, int)

Types

type Catcher

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

Catcher wraps an Interface with a Pull method that recovers panics and turns them into errors. It should be wrapped around the output puller of a flowgraph and the top-level puller of any goroutine created inside of a flowgraph.

func NewCatcher

func NewCatcher(parent zbuf.Puller) *Catcher

func (*Catcher) Pull

func (c *Catcher) Pull(done bool) (b zbuf.Batch, err error)

type Context

type Context struct {
	context.Context
	Logger *zap.Logger
	// WaitGroup is used to ensure that goroutines complete cleanup work
	// (e.g., removing temporary files) before Cancel returns.
	WaitGroup sync.WaitGroup
	Zctx      *zed.Context
	// contains filtered or unexported fields
}

Context provides states used by all procs to provide the outside context in which they are running.

func DefaultContext

func DefaultContext() *Context

func NewContext

func NewContext(ctx context.Context, zctx *zed.Context, logger *zap.Logger) *Context

func (*Context) Cancel

func (c *Context) Cancel()

Cancel cancels the context. Cancel must be called to ensure that operators complete cleanup work (e.g., removing temporary files).

type EndOfChannel

type EndOfChannel int

EndOfChannel is an empty batch that represents the termination of one of the output paths of a muxed flowgraph and thus will be ignored downstream unless explicitly detected.

func (*EndOfChannel) Ref

func (*EndOfChannel) Ref()

func (*EndOfChannel) Unref

func (*EndOfChannel) Unref()

func (*EndOfChannel) Values

func (*EndOfChannel) Values() []zed.Value

func (*EndOfChannel) Vars

func (*EndOfChannel) Vars() []zed.Value

type Mux

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

Mux implements the muxing of a set of parallel paths at the output of a flowgraph. It also implements the double-EOS algorithm with proc.Latch to detect the end of each parallel stream. Its output protocol is a single EOS when all of the upstream legs are done at which time it cancels the flowgraoh. Each batch returned by the mux is wrapped in a Batch, which can be unwrappd with Unwrap to extract the integer index of the output (in left-to-right DFS traversal order of the flowgraph). This proc requires more than one parent; use proc.Latcher for a single-output flowgraph.

func NewMux

func NewMux(octx *Context, parents []zbuf.Puller) *Mux

func (*Mux) Pull

func (m *Mux) Pull(bool) (zbuf.Batch, error)

Pull implements the merge logic for returning data from the upstreams.

type Result

type Result struct {
	Batch zbuf.Batch
	Err   error
}

Result is a convenient way to bundle the result of Proc.Pull() to send over channels.

type Router

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

func NewRouter

func NewRouter(ctx context.Context, parent zbuf.Puller) *Router

func (*Router) AddRoute

func (r *Router) AddRoute() zbuf.Puller
func (r *Router) Link(s Selector)

func (*Router) Send

func (r *Router) Send(p zbuf.Puller, b zbuf.Batch, err error) bool

type Selector

type Selector interface {
	Forward(*Router, zbuf.Batch) bool
}

type Single

type Single struct {
	zbuf.Puller
	// contains filtered or unexported fields
}

func NewSingle

func NewSingle(parent zbuf.Puller) *Single

func (*Single) Pull

func (s *Single) Pull(bool) (zbuf.Batch, error)

Directories

Path Synopsis
A combine proc merges multiple upstream inputs into one output.
A combine proc merges multiple upstream inputs into one output.

Jump to

Keyboard shortcuts

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