Documentation
¶
Overview ¶
Package processing provides the single dynamic processing engine for Pulse. It implements aggregators, attributes, filterers, and groupers that operate on record iterators backed by .pulse encoded data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator interface {
// Aggregate computes the aggregation over the given records for the named field.
Aggregate(records []*Record, field string) (float64, error)
}
Aggregator computes a single aggregate value from a set of records.
type AggregatorFactory ¶
type AggregatorFactory func(agg *types.Aggregation, schema *encoding.Schema) (Aggregator, error)
AggregatorFactory creates an Aggregator from a type specification.
type AttributeComputer ¶
type AttributeComputer interface {
// Compute calculates derived values for all records, returning a value per record.
// The returned slice has one entry per record. A nil second return means no null handling.
Compute(records []*Record, field string) ([]float64, error)
}
AttributeComputer computes derived attribute values for each record.
type AttributeFactory ¶
type AttributeFactory func(attr *types.Attribute, schema *encoding.Schema) (AttributeComputer, error)
AttributeFactory creates an AttributeComputer from a type specification.
type FilterFunc ¶
FilterFunc evaluates whether a record passes a filter.
type FiltererBuilder ¶
type FiltererBuilder interface {
// Build creates a filter function from the filter specification.
Build(filter *types.Filterer, schema *encoding.Schema) (FilterFunc, error)
}
FiltererBuilder constructs a FilterFunc from a filter specification.
type FiltererFactory ¶
type FiltererFactory func() FiltererBuilder
FiltererFactory creates a FiltererBuilder from a type specification.
type Grouper ¶
type Grouper interface {
// Group partitions the records by the specified field, returning a map of group key to records.
Group(records []*Record, field string) (map[string][]*Record, error)
}
Grouper partitions records into named groups.
type GrouperFactory ¶
GrouperFactory creates a Grouper from a type specification.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is the single dynamic processing engine for Pulse. It handles filtering, attribute computation, grouping, and aggregation over record iterators backed by .pulse encoded data.
func NewProcessor ¶
NewProcessor creates a new Processor for the given schema.
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record represents a single data row with field accessors. It provides both numeric and string access for processing operations.
func NewRecordWithNulls ¶
func NewRecordWithNulls(schema *encoding.Schema, values map[string]float64, nulls map[string]bool) *Record
NewRecordWithNulls creates a record with explicit null tracking.
func (*Record) NumericValue ¶
NumericValue returns the numeric value for the named field. Returns the value and true if present and non-null, or 0 and false if null or missing.
type RecordIterator ¶
type RecordIterator interface {
// Next advances to the next record. Returns false when exhausted.
Next() bool
// Record returns the current record. Only valid after Next returns true.
Record() *Record
// Reset resets the iterator to the beginning.
Reset()
}
RecordIterator provides sequential access to records.
type SliceIterator ¶
type SliceIterator struct {
// contains filtered or unexported fields
}
SliceIterator implements RecordIterator over a slice of records.
func NewSliceIterator ¶
func NewSliceIterator(records []*Record) *SliceIterator
NewSliceIterator creates an iterator over the given records.
func (*SliceIterator) Record ¶
func (it *SliceIterator) Record() *Record
Record returns the current record.
func (*SliceIterator) Reset ¶
func (it *SliceIterator) Reset()
Reset resets the iterator to the beginning.