zbuf

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: BSD-3-Clause Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PullerBatchValues = 100

PullerBatchValues is the maximum number of values per batch for a Puller created by NewPuller.

Functions

func CopyPuller

func CopyPuller(w zio.Writer, p Puller) error

func NamedScanner

func NamedScanner(s Scanner, name string) *namedScanner

func NewComparator added in v1.0.0

func NewComparator(zctx *zed.Context, sortKey order.SortKey) *expr.Comparator

func NewComparatorNullsMax added in v1.6.0

func NewComparatorNullsMax(zctx *zed.Context, sortKey order.SortKey) *expr.Comparator

func NoControl added in v1.0.0

func NoControl(r zio.Reader) *noControl

func PullerReader

func PullerReader(p Puller) zio.Reader

func WriteBatch added in v0.32.0

func WriteBatch(zw zio.Writer, batch Batch) error

WriteBatch writes the values in batch to zw. If an error occurs, WriteBatch stops and returns the error.

Types

type Array

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

Array is a slice of of records that implements the Batch and the Reader interfaces.

func NewArray added in v1.0.0

func NewArray(arena *zed.Arena, vals []zed.Value) *Array

XXX this should take the frame arg too and the procs that create new arrays need to propagate their frames downstream.

func (*Array) Read

func (a *Array) Read() (*zed.Value, error)

Read returns removes the first element of the Array and returns it, or it returns nil if the Array is empty.

func (*Array) Ref

func (a *Array) Ref()

func (*Array) Reset added in v1.16.0

func (a *Array) Reset()

func (*Array) Unref

func (a *Array) Unref()

func (*Array) Values added in v0.32.0

func (a *Array) Values() []zed.Value

func (*Array) Vars added in v1.0.0

func (a *Array) Vars() []zed.Value

func (*Array) Write

func (a *Array) Write(r zed.Value) error

func (*Array) Zctx added in v1.16.0

func (*Array) Zctx() *zed.Arena

type Batch

type Batch interface {
	Ref()
	Unref()
	Values() []zed.Value
	Vars() []zed.Value
}

func NewBatch added in v1.0.0

func NewBatch(arena *zed.Arena, vals []zed.Value, b Batch, vars []zed.Value) Batch

func NewBatchWithVars added in v1.16.0

func NewBatchWithVars(arena *zed.Arena, vals []zed.Value, vars []zed.Value) Batch

func NewBatchWithVarsAndFree added in v1.16.0

func NewBatchWithVarsAndFree(arena *zed.Arena, vals []zed.Value, vars []zed.Value, free func()) Batch

func WrapBatch added in v1.16.0

func WrapBatch(b Batch, vals []zed.Value) Batch

type Control added in v1.0.0

type Control struct {
	Message interface{}
}

func (*Control) Error added in v1.0.0

func (c *Control) Error() string

type EndChannel added in v1.0.0

type EndChannel int

type File

type File struct {
	zio.Reader
	// contains filtered or unexported fields
}

func NewFile

func NewFile(r zio.Reader, c io.Closer, name string) *File

func (*File) Close

func (r *File) Close() error

func (*File) String

func (r *File) String() string

type Filter

type Filter interface {
	AsEvaluator() (expr.Evaluator, error)
	AsBufferFilter() (*expr.BufferFilter, error)
}

type Meter added in v1.0.0

type Meter interface {
	Progress() Progress
}

A Meter provides Progress statistics.

type MultiStats

type MultiStats []Scanner

func (MultiStats) Progress added in v1.0.0

func (m MultiStats) Progress() Progress

type Progress added in v1.0.0

type Progress struct {
	BytesRead      int64 `zed:"bytes_read" json:"bytes_read"`
	BytesMatched   int64 `zed:"bytes_matched" json:"bytes_matched"`
	RecordsRead    int64 `zed:"records_read" json:"records_read"`
	RecordsMatched int64 `zed:"records_matched" json:"records_matched"`
}

Progress represents progress statistics from a Scanner.

func (*Progress) Add added in v1.0.0

func (p *Progress) Add(in Progress)

Add updates its receiver by adding to it the values in ss.

func (*Progress) Copy added in v1.0.0

func (p *Progress) Copy() Progress

func (*Progress) Progress added in v1.3.0

func (p *Progress) Progress() Progress

type ProgressReadCloser added in v1.0.0

type ProgressReadCloser interface {
	zio.ReadCloser
	Progress() Progress
}

func MeterReadCloser added in v1.0.0

func MeterReadCloser(rc zio.ReadCloser) ProgressReadCloser

type ProgressReader added in v1.0.0

type ProgressReader interface {
	zio.Reader
	Progress() Progress
}

type Puller

type Puller interface {
	Pull(bool) (Batch, error)
}

A Puller produces Batches of records, signaling end-of-stream (EOS) by returning a nil Batch and nil error. The done argument to Pull indicates that the stream should be terminated before its natural EOS. An implementation must return EOS in response to a Pull call when the done parameter is true. After seeing EOS, (either via done or its natural end), an implementation of an operator that processes pulled data should respond to additional calls to Pull as if restarting in its initial state. For original sources of data (e.g., the from operator), once EOS is reached, additional calls to Pull after the first EOS should always return EOS. Pull is not safe to call concurrently.

func NewPuller

func NewPuller(zr zio.Reader) Puller

NewPuller returns a puller for zr that returns batches containing up to PullerBatchValues values.

type Scanner

type Scanner interface {
	Meter
	Puller
}

A Scanner is a Batch source that also provides progress updates.

func MultiScanner added in v1.3.0

func MultiScanner(scanners ...Scanner) Scanner

func NewScanner

func NewScanner(ctx context.Context, r zio.Reader, filterExpr Filter) (Scanner, error)

NewScanner returns a Scanner for r that filters records by filterExpr and s. If r implements fmt.Stringer, the scanner reports errors using a prefix of the string returned by its String method.

type ScannerAble

type ScannerAble interface {
	NewScanner(ctx context.Context, filterExpr Filter) (Scanner, error)
}

ScannerAble is implemented by Readers that provide an optimized implementation of the Scanner interface.

type SetChannel added in v1.0.0

type SetChannel int

Jump to

Keyboard shortcuts

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