proc

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BatchLen = 100

Variables

This section is empty.

Functions

func EOS

func EOS(batch zbuf.Batch, err error) bool

func FromFunction

func FromFunction(pctx *Context, parent Interface, f Function) *applier

func NopDone

func NopDone(puller zbuf.Puller) *done

Types

type Context

type Context struct {
	context.Context
	Logger   *zap.Logger
	Warnings chan string
	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()

type Function

type Function interface {
	fmt.Stringer
	Apply(*zed.Record) (*zed.Record, error)
	Warning() string
}

type Interface

type Interface interface {
	zbuf.Puller
	Done()
}

proc.Interface is the interface to objects that operate on Batches of zed.Records and are arranged into a flowgraph to perform pattern matching and analytics. A proc is generally single-threaded unless lengths are taken to implement concurrency within a Proc. The model is receiver-driven, stream-oriented data processing. Downstream procs Pull() batches of data from upstream procs. Normally, a proc pulls data until end of stream (nil batch and nil error) or error (nil batch and non-nil error). If a proc wants to end before end of stream, it calls the Done() method on its parent. A proc implementation may assume calls to Pull() and Done() are single threaded so any arrangement of calls to Pull() and Done() cannot be done concurrently. In short, never call Done() concurrently to another goroutine calling Pull().

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 Scheduler

type Scheduler interface {
	PullScanTask() (zbuf.PullerCloser, error)
	Stats() zbuf.ScannerStats
}

Directories

Path Synopsis
A combine proc merges multiple upstream inputs into one output.
A combine proc merges multiple upstream inputs into one output.
A mux proc merges multiple upstream inputs into one output like combine but labels each batch.
A mux proc merges multiple upstream inputs into one output like combine but labels each batch.
rename renames one or more fields in a record.
rename renames one or more fields in a record.

Jump to

Keyboard shortcuts

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