execute

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2018 License: AGPL-3.0, AGPL-3.0-or-later Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultValueColLabel = "_value"
	TimeColLabel         = "_time"
)
View Source
const (
	InvalidColKind = iota
	TimeColKind
	TagColKind
	ValueColKind
)
View Source
const (
	MaxTime = math.MaxInt64
	MinTime = math.MinInt64
)

Variables

View Source
var AllTime = Bounds{
	Start: MinTime,
	Stop:  MaxTime,
}
View Source
var DefaultTriggerSpec = query.AfterWatermarkTriggerSpec{}

DefaultTriggerSpec defines the triggering that should be used for datasets whose parent transformation is not a windowing transformation.

View Source
var NoDefaultValueColumn = fmt.Errorf("no default value column %q found.", DefaultValueColLabel)
View Source
var (
	TimeCol = ColMeta{
		Label: TimeColLabel,
		Type:  TTime,
		Kind:  TimeColKind,
	}
)

Functions

func AddBlockCols

func AddBlockCols(b Block, builder BlockBuilder)

AddBlockCols adds the columns of b onto builder.

func AddNewCols

func AddNewCols(b Block, builder BlockBuilder) []int

AddNewCols adds the columns of b onto builder that did not already exist. Returns the mapping of builder cols to block cols.

func AddTags

func AddTags(t Tags, b BlockBuilder)

AddTags add columns to the builder for the given tags. It is assumed that all tags are common to all rows of this block.

func AppendBlock

func AppendBlock(b Block, builder BlockBuilder, colMap []int)

AppendBlock append data from block b onto builder. The colMap is a map of builder columnm index to block column index. AppendBlock is OneTimeBlock safe.

func AppendRow

func AppendRow(i int, rr RowReader, builder BlockBuilder, colMap []int)

AppendRow appends a single row from rr onto builder. The colMap is a map of builder columnm index to rr column index.

func AppendRowForCols added in v0.0.5

func AppendRowForCols(i int, rr RowReader, builder BlockBuilder, cols []ColMeta, colMap []int)

AppendRowForCols appends a single row from rr onto builder for the specified cols. The colMap is a map of builder columnm index to rr column index.

func AppendValue added in v0.0.5

func AppendValue(builder BlockBuilder, j int, v compiler.Value)

func ColIdx added in v0.0.4

func ColIdx(label string, cols []ColMeta) int

func ConvertToKind added in v0.0.5

func ConvertToKind(t DataType) semantic.Kind

func NewAggregateTransformation

func NewAggregateTransformation(d Dataset, c BlockBuilderCache, bounds Bounds, agg Aggregate) *aggregateTransformation

func NewBlockBuilderCache

func NewBlockBuilderCache(a *Allocator) *blockBuilderCache

func NewDataset

func NewDataset(id DatasetID, accMode AccumulationMode, cache DataCache) *dataset

func NewIndexSelectorTransformation

func NewIndexSelectorTransformation(d Dataset, c BlockBuilderCache, bounds Bounds, selector IndexSelector, colLabel string, useRowTime bool) *indexSelectorTransformation

func NewRowSelectorTransformation

func NewRowSelectorTransformation(d Dataset, c BlockBuilderCache, bounds Bounds, selector RowSelector, colLabel string, useRowTime bool) *rowSelectorTransformation

func PanicUnknownType

func PanicUnknownType(typ DataType)

func RegisterSource

func RegisterSource(k plan.ProcedureKind, c CreateSource)

func RegisterTransformation

func RegisterTransformation(k plan.ProcedureKind, c CreateTransformation)

func TimeIdx

func TimeIdx(cols []ColMeta) int

func ToStoragePredicate added in v0.0.4

func ToStoragePredicate(f *semantic.FunctionExpression) (*storage.Predicate, error)

func ValueForRow

func ValueForRow(i, j int, rr RowReader) compiler.Value

func ValueIdx

func ValueIdx(cols []ColMeta) int

Types

type AccumulationMode

type AccumulationMode int
const (
	DiscardingMode AccumulationMode = iota
	AccumulatingMode
	AccumulatingRetractingMode
)

type Administration added in v0.0.4

type Administration interface {
	ResolveTime(qt query.Time) Time
	Bounds() Bounds
	Allocator() *Allocator
	Parents() []DatasetID
	ConvertID(plan.ProcedureID) DatasetID
}

type Aggregate

type Aggregate interface {
	NewBoolAgg() DoBoolAgg
	NewIntAgg() DoIntAgg
	NewUIntAgg() DoUIntAgg
	NewFloatAgg() DoFloatAgg
	NewStringAgg() DoStringAgg
}

type AllocError added in v0.0.3

type AllocError struct {
	Limit     int64
	Allocated int64
	Wanted    int64
}

func (AllocError) Error added in v0.0.3

func (a AllocError) Error() string

type Allocator added in v0.0.3

type Allocator struct {
	Limit int64
	// contains filtered or unexported fields
}

Allocator tracks the amount of memory being consumed by a query. The allocator provides methods similar to make and append, to allocate large slices of data. The allocator also provides a Free method to account for when memory will be freed.

func (*Allocator) AppendBools added in v0.0.3

func (a *Allocator) AppendBools(slice []bool, vs ...bool) []bool

AppendBools appends bools to a slice

func (*Allocator) AppendFloats added in v0.0.3

func (a *Allocator) AppendFloats(slice []float64, vs ...float64) []float64

AppendFloats appends float64s to a slice

func (*Allocator) AppendInts added in v0.0.3

func (a *Allocator) AppendInts(slice []int64, vs ...int64) []int64

AppendInts appends int64s to a slice

func (*Allocator) AppendStrings added in v0.0.3

func (a *Allocator) AppendStrings(slice []string, vs ...string) []string

AppendStrings appends strings to a slice. Only the string headers are accounted for.

func (*Allocator) AppendTimes added in v0.0.3

func (a *Allocator) AppendTimes(slice []Time, vs ...Time) []Time

AppendTimes appends Times to a slice

func (*Allocator) AppendUInts added in v0.0.3

func (a *Allocator) AppendUInts(slice []uint64, vs ...uint64) []uint64

AppendUInts appends uint64s to a slice

func (*Allocator) Bools added in v0.0.3

func (a *Allocator) Bools(l, c int) []bool

Bools makes a slice of bool values.

func (*Allocator) Floats added in v0.0.3

func (a *Allocator) Floats(l, c int) []float64

Floats makes a slice of float64 values.

func (*Allocator) Free added in v0.0.3

func (a *Allocator) Free(n, size int)

Free informs the allocator that memory has been freed.

func (*Allocator) Ints added in v0.0.3

func (a *Allocator) Ints(l, c int) []int64

Ints makes a slice of int64 values.

func (*Allocator) Max added in v0.0.3

func (a *Allocator) Max() int64

Max reports the maximum amount of allocated memory at any point in the query.

func (*Allocator) Strings added in v0.0.3

func (a *Allocator) Strings(l, c int) []string

Strings makes a slice of string values. Only the string headers are accounted for.

func (*Allocator) Times added in v0.0.3

func (a *Allocator) Times(l, c int) []Time

Times makes a slice of Time values.

func (*Allocator) UInts added in v0.0.3

func (a *Allocator) UInts(l, c int) []uint64

UInts makes a slice of uint64 values.

type Block

type Block interface {
	BlockMetadata

	Cols() []ColMeta
	// Col returns an iterator to consume the values for a given column.
	Col(c int) ValueIterator

	// Times returns an iterator to consume the values for the "_time" column.
	Times() ValueIterator
	// Values returns an iterator to consume the values for the "_value" column.
	// If no column exists and error is returned
	Values() (ValueIterator, error)

	// RefCount modifies the reference count on the block by n.
	// When the RefCount goes to zero, the block is freed.
	RefCount(n int)
}

func CacheOneTimeBlock

func CacheOneTimeBlock(b Block, a *Allocator) Block

CacheOneTimeBlock returns a block that can be read multiple times. If the block is not a OneTimeBlock it is returned directly. Otherwise its contents are read into a new block.

func CopyBlock

func CopyBlock(b Block, a *Allocator) Block

CopyBlock returns a copy of the block and is OneTimeBlock safe.

type BlockBuilder

type BlockBuilder interface {
	SetBounds(Bounds)

	BlockMetadata

	NRows() int
	NCols() int
	Cols() []ColMeta

	// AddCol increases the size of the block by one column.
	// The index of the column is returned.
	AddCol(ColMeta) int

	// Set sets the value at the specified coordinates
	// The rows and columns must exist before calling set, otherwise Set panics.
	SetBool(i, j int, value bool)
	SetInt(i, j int, value int64)
	SetUInt(i, j int, value uint64)
	SetFloat(i, j int, value float64)
	SetString(i, j int, value string)
	SetTime(i, j int, value Time)

	// SetCommonString sets a single value for the entire column.
	SetCommonString(j int, value string)

	AppendBool(j int, value bool)
	AppendInt(j int, value int64)
	AppendUInt(j int, value uint64)
	AppendFloat(j int, value float64)
	AppendString(j int, value string)
	AppendTime(j int, value Time)

	AppendFloats(j int, values []float64)
	AppendStrings(j int, values []string)
	AppendTimes(j int, values []Time)

	// Sort the rows of the by the values of the columns in the order listed.
	Sort(cols []string, desc bool)

	// Clear removes all rows, while preserving the column meta data.
	ClearData()

	// Block returns the block that has been built.
	// Further modifications of the builder will not effect the returned block.
	Block() (Block, error)
}

BlockBuilder builds blocks that can be used multiple times

type BlockBuilderCache

type BlockBuilderCache interface {
	// BlockBuilder returns an existing or new BlockBuilder for the given meta data.
	// The boolean return value indicates if BlockBuilder is new.
	BlockBuilder(meta BlockMetadata) (BlockBuilder, bool)
	ForEachBuilder(f func(BlockKey, BlockBuilder))
}

type BlockContext

type BlockContext struct {
	Bounds Bounds
	Count  int
}

type BlockIterator

type BlockIterator interface {
	Do(f func(Block) error) error
}

type BlockKey

type BlockKey string

func ToBlockKey

func ToBlockKey(meta BlockMetadata) BlockKey

type BlockMetadata

type BlockMetadata interface {
	Bounds() Bounds
	Tags() Tags
}

type BoolValueFunc

type BoolValueFunc interface {
	ValueBool() bool
}

type Bounds

type Bounds struct {
	Start Time
	Stop  Time
}

func (Bounds) Contains

func (b Bounds) Contains(t Time) bool

func (Bounds) Equal

func (b Bounds) Equal(o Bounds) bool

func (Bounds) Overlaps

func (b Bounds) Overlaps(o Bounds) bool

func (Bounds) Shift added in v0.0.4

func (b Bounds) Shift(d Duration) Bounds

func (Bounds) String

func (b Bounds) String() string

type ColKind added in v0.0.4

type ColKind int

func (ColKind) String added in v0.0.5

func (k ColKind) String() string

type ColListBlock

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

ColListBlock implements Block using list of columns. All data for the block is stored in RAM. As a result At* methods are provided directly on the block for easy access.

func (*ColListBlock) AtBool

func (b *ColListBlock) AtBool(i, j int) bool

func (*ColListBlock) AtFloat

func (b *ColListBlock) AtFloat(i, j int) float64

func (*ColListBlock) AtInt

func (b *ColListBlock) AtInt(i, j int) int64

func (*ColListBlock) AtString

func (b *ColListBlock) AtString(i, j int) string

func (*ColListBlock) AtTime

func (b *ColListBlock) AtTime(i, j int) Time

func (*ColListBlock) AtUInt

func (b *ColListBlock) AtUInt(i, j int) uint64

func (*ColListBlock) Bounds

func (b *ColListBlock) Bounds() Bounds

func (*ColListBlock) Col

func (b *ColListBlock) Col(c int) ValueIterator

func (*ColListBlock) Cols

func (b *ColListBlock) Cols() []ColMeta

func (*ColListBlock) Copy

func (b *ColListBlock) Copy() *ColListBlock

func (ColListBlock) NRows

func (b ColListBlock) NRows() int

func (*ColListBlock) RefCount added in v0.0.3

func (b *ColListBlock) RefCount(n int)

func (*ColListBlock) Tags

func (b *ColListBlock) Tags() Tags

func (*ColListBlock) Times

func (b *ColListBlock) Times() ValueIterator

func (*ColListBlock) Values

func (b *ColListBlock) Values() (ValueIterator, error)

type ColListBlockBuilder

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

func NewColListBlockBuilder

func NewColListBlockBuilder(a *Allocator) *ColListBlockBuilder

func (ColListBlockBuilder) AddCol

func (b ColListBlockBuilder) AddCol(c ColMeta) int

func (ColListBlockBuilder) AppendBool

func (b ColListBlockBuilder) AppendBool(j int, value bool)

func (ColListBlockBuilder) AppendBools

func (b ColListBlockBuilder) AppendBools(j int, values []bool)

func (ColListBlockBuilder) AppendFloat

func (b ColListBlockBuilder) AppendFloat(j int, value float64)

func (ColListBlockBuilder) AppendFloats

func (b ColListBlockBuilder) AppendFloats(j int, values []float64)

func (ColListBlockBuilder) AppendInt

func (b ColListBlockBuilder) AppendInt(j int, value int64)

func (ColListBlockBuilder) AppendInts

func (b ColListBlockBuilder) AppendInts(j int, values []int64)

func (ColListBlockBuilder) AppendString

func (b ColListBlockBuilder) AppendString(j int, value string)

func (ColListBlockBuilder) AppendStrings

func (b ColListBlockBuilder) AppendStrings(j int, values []string)

func (ColListBlockBuilder) AppendTime

func (b ColListBlockBuilder) AppendTime(j int, value Time)

func (ColListBlockBuilder) AppendTimes

func (b ColListBlockBuilder) AppendTimes(j int, values []Time)

func (ColListBlockBuilder) AppendUInt

func (b ColListBlockBuilder) AppendUInt(j int, value uint64)

func (ColListBlockBuilder) AppendUInts

func (b ColListBlockBuilder) AppendUInts(j int, values []uint64)

func (ColListBlockBuilder) Block

func (b ColListBlockBuilder) Block() (Block, error)

func (ColListBlockBuilder) Bounds

func (b ColListBlockBuilder) Bounds() Bounds

func (ColListBlockBuilder) ClearData

func (b ColListBlockBuilder) ClearData()

func (ColListBlockBuilder) Cols

func (b ColListBlockBuilder) Cols() []ColMeta

func (ColListBlockBuilder) NCols

func (b ColListBlockBuilder) NCols() int

func (ColListBlockBuilder) NRows

func (b ColListBlockBuilder) NRows() int

func (ColListBlockBuilder) RawBlock

func (b ColListBlockBuilder) RawBlock() *ColListBlock

RawBlock returns the underlying block being constructed. The Block returned will be modified by future calls to any BlockBuilder methods.

func (ColListBlockBuilder) SetBool

func (b ColListBlockBuilder) SetBool(i int, j int, value bool)

func (ColListBlockBuilder) SetBounds

func (b ColListBlockBuilder) SetBounds(bounds Bounds)

func (ColListBlockBuilder) SetCommonString

func (b ColListBlockBuilder) SetCommonString(j int, value string)

func (ColListBlockBuilder) SetFloat

func (b ColListBlockBuilder) SetFloat(i int, j int, value float64)

func (ColListBlockBuilder) SetInt

func (b ColListBlockBuilder) SetInt(i int, j int, value int64)

func (ColListBlockBuilder) SetString

func (b ColListBlockBuilder) SetString(i int, j int, value string)

func (ColListBlockBuilder) SetTime

func (b ColListBlockBuilder) SetTime(i int, j int, value Time)

func (ColListBlockBuilder) SetUInt

func (b ColListBlockBuilder) SetUInt(i int, j int, value uint64)

func (ColListBlockBuilder) Sort

func (b ColListBlockBuilder) Sort(cols []string, desc bool)

func (ColListBlockBuilder) Tags

func (b ColListBlockBuilder) Tags() Tags

type ColMeta

type ColMeta struct {
	Label string
	Type  DataType
	Kind  ColKind
	// Common indicates that the value for the column is shared by all rows.
	Common bool
}

func ValueCol

func ValueCol(cols []ColMeta) (ColMeta, error)

func (ColMeta) IsTag

func (c ColMeta) IsTag() bool

func (ColMeta) IsTime added in v0.0.4

func (c ColMeta) IsTime() bool

func (ColMeta) IsValue added in v0.0.4

func (c ColMeta) IsValue() bool

type Config

type Config struct {
	StorageReader StorageReader
}

type CreateSource

type CreateSource func(spec plan.ProcedureSpec, id DatasetID, sr StorageReader, ctx Administration) Source

type CreateTransformation

type CreateTransformation func(id DatasetID, mode AccumulationMode, spec plan.ProcedureSpec, a Administration) (Transformation, Dataset, error)

type DataCache

type DataCache interface {
	BlockMetadata(BlockKey) BlockMetadata
	Block(BlockKey) (Block, error)

	ForEach(func(BlockKey))
	ForEachWithContext(func(BlockKey, Trigger, BlockContext))

	DiscardBlock(BlockKey)
	ExpireBlock(BlockKey)

	SetTriggerSpec(t query.TriggerSpec)
}

DataCache holds all working data for a transformation.

type DataType

type DataType int
const (
	TInvalid DataType = iota
	TBool
	TInt
	TUInt
	TFloat
	TString
	TTime
)

func ConvertFromKind added in v0.0.5

func ConvertFromKind(k semantic.Kind) DataType

func (DataType) String

func (t DataType) String() string

type Dataset

type Dataset interface {
	Node

	RetractBlock(key BlockKey) error
	UpdateProcessingTime(t Time) error
	UpdateWatermark(mark Time) error
	Finish(error)

	SetTriggerSpec(t query.TriggerSpec)
}

Dataset represents the set of data produced by a transformation.

func NewAggregateTransformationAndDataset

func NewAggregateTransformationAndDataset(id DatasetID, mode AccumulationMode, bounds Bounds, agg Aggregate, a *Allocator) (*aggregateTransformation, Dataset)

func NewIndexSelectorTransformationAndDataset

func NewIndexSelectorTransformationAndDataset(id DatasetID, mode AccumulationMode, bounds Bounds, selector IndexSelector, colLabel string, useRowTime bool, a *Allocator) (*indexSelectorTransformation, Dataset)

func NewRowSelectorTransformationAndDataset

func NewRowSelectorTransformationAndDataset(id DatasetID, mode AccumulationMode, bounds Bounds, selector RowSelector, colLabel string, useRowTime bool, a *Allocator) (*rowSelectorTransformation, Dataset)

type DatasetID

type DatasetID uuid.UUID
var ZeroDatasetID DatasetID

func (DatasetID) IsZero

func (id DatasetID) IsZero() bool

func (DatasetID) String

func (id DatasetID) String() string

type Dispatcher added in v0.0.3

type Dispatcher interface {
	// Schedule fn to be executed
	Schedule(fn ScheduleFunc)
}

Dispatcher schedules work for a query. Each transformation submits work to be done to the dispatcher. Then the dispatcher schedules to work based on the available resources.

type DoBoolAgg

type DoBoolAgg interface {
	ValueFunc
	DoBool([]bool)
}

type DoBoolIndexSelector

type DoBoolIndexSelector interface {
	DoBool([]bool) []int
}

type DoBoolRowSelector

type DoBoolRowSelector interface {
	Rower
	// What if the selector doesn't know yet and needs to wait all is finalized?
	DoBool(vs []bool, rr RowReader)
}

type DoFloatAgg

type DoFloatAgg interface {
	ValueFunc
	DoFloat([]float64)
}

type DoFloatIndexSelector

type DoFloatIndexSelector interface {
	DoFloat([]float64) []int
}

type DoFloatRowSelector

type DoFloatRowSelector interface {
	Rower
	DoFloat(vs []float64, rr RowReader)
}

type DoIntAgg

type DoIntAgg interface {
	ValueFunc
	DoInt([]int64)
}

type DoIntIndexSelector

type DoIntIndexSelector interface {
	DoInt([]int64) []int
}

type DoIntRowSelector

type DoIntRowSelector interface {
	Rower
	DoInt(vs []int64, rr RowReader)
}

type DoStringAgg

type DoStringAgg interface {
	ValueFunc
	DoString([]string)
}

type DoStringIndexSelector

type DoStringIndexSelector interface {
	DoString([]string) []int
}

type DoStringRowSelector

type DoStringRowSelector interface {
	Rower
	DoString(vs []string, rr RowReader)
}

type DoUIntAgg

type DoUIntAgg interface {
	ValueFunc
	DoUInt([]uint64)
}

type DoUIntIndexSelector

type DoUIntIndexSelector interface {
	DoUInt([]uint64) []int
}

type DoUIntRowSelector

type DoUIntRowSelector interface {
	Rower
	DoUInt(vs []uint64, rr RowReader)
}

type Duration

type Duration int64

func (Duration) String

func (d Duration) String() string

type Executor

type Executor interface {
	Execute(context.Context, *plan.PlanSpec) (map[string]Result, error)
}

func NewExecutor

func NewExecutor(c Config) Executor

type FinishMsg

type FinishMsg interface {
	Message
	Error() error
}

type FloatValueFunc

type FloatValueFunc interface {
	ValueFloat() float64
}

type FormatOptions

type FormatOptions struct {
	// RepeatHeaderCount is the number of rows to print before printing the header again.
	// If zero then the headers are not repeated.
	RepeatHeaderCount int
}

func DefaultFormatOptions

func DefaultFormatOptions() *FormatOptions

type Formatter

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

Formatter writes a block to a Writer.

func NewFormatter

func NewFormatter(b Block, opts *FormatOptions) *Formatter

NewFormatter creates a Formatter for a given block. If opts is nil, the DefaultFormatOptions are used.

func (*Formatter) WriteTo

func (f *Formatter) WriteTo(out io.Writer) (int64, error)

WriteTo writes the formatted block data to w.

type IndexSelector

type IndexSelector interface {
	NewBoolSelector() DoBoolIndexSelector
	NewIntSelector() DoIntIndexSelector
	NewUIntSelector() DoUIntIndexSelector
	NewFloatSelector() DoFloatIndexSelector
	NewStringSelector() DoStringIndexSelector
}

type IntValueFunc

type IntValueFunc interface {
	ValueInt() int64
}

type Message

type Message interface {
	Type() MessageType
	SrcDatasetID() DatasetID
}

type MessageQueue added in v0.0.3

type MessageQueue interface {
	Push(Message)
	Pop() Message
}

MessageQueue provides a concurrency safe queue for messages. The queue must have a single consumer calling Pop.

type MessageType

type MessageType int
const (
	RetractBlockType MessageType = iota
	ProcessType
	UpdateWatermarkType
	UpdateProcessingTimeType
	FinishType
)

type Node

type Node interface {
	AddTransformation(t Transformation)
}

type OneTimeBlock

type OneTimeBlock interface {
	Block
	// contains filtered or unexported methods
}

OneTimeBlock is a Block that permits reading data only once. Specifically the ValueIterator may only be consumed once from any of the columns.

type ProcessMsg

type ProcessMsg interface {
	Message
	Block() Block
}

type ReadSpec

type ReadSpec struct {
	RAMLimit     uint64
	Database     string
	Hosts        []string
	Predicate    *semantic.FunctionExpression
	PointsLimit  int64
	SeriesLimit  int64
	SeriesOffset int64
	Descending   bool

	AggregateMethod string

	// OrderByTime indicates that series reads should produce all
	// series for a time before producing any series for a larger time.
	// By default this is false meaning all values of time are produced for a given series,
	// before any values are produced from the next series.
	OrderByTime bool
	// MergeAll indicates that all series should be merged into a single group
	MergeAll bool
	// GroupKeys is the list of dimensions along which to group
	GroupKeys []string
	// GroupExcept is the list of dimensions along which to not group
	GroupExcept []string
	// GroupKeep is the list of tags to keep but not group by.
	GroupKeep []string
}

type Result

type Result interface {
	Blocks() BlockIterator
	// contains filtered or unexported methods
}

type RetractBlockMsg

type RetractBlockMsg interface {
	Message
	BlockMetadata() BlockMetadata
}

type Row

type Row struct {
	Values []interface{}
}

func ReadRow

func ReadRow(i int, rr RowReader) (row Row)

type RowMapFn added in v0.0.4

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

func NewRowMapFn added in v0.0.4

func NewRowMapFn(fn *semantic.FunctionExpression) (*RowMapFn, error)

func (*RowMapFn) Eval added in v0.0.4

func (f *RowMapFn) Eval(row int, rr RowReader) (*compiler.Object, error)

func (*RowMapFn) Prepare added in v0.0.4

func (f *RowMapFn) Prepare(cols []ColMeta) error

func (*RowMapFn) Type added in v0.0.5

func (f *RowMapFn) Type() semantic.Type

type RowPredicateFn added in v0.0.4

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

func NewRowPredicateFn added in v0.0.4

func NewRowPredicateFn(fn *semantic.FunctionExpression) (*RowPredicateFn, error)

func (*RowPredicateFn) Eval added in v0.0.4

func (f *RowPredicateFn) Eval(row int, rr RowReader) (bool, error)

func (*RowPredicateFn) Prepare added in v0.0.4

func (f *RowPredicateFn) Prepare(cols []ColMeta) error

type RowReader

type RowReader interface {
	Cols() []ColMeta
	// AtBool returns the bool value of another column and given index.
	AtBool(i, j int) bool
	// AtInt returns the int value of another column and given index.
	AtInt(i, j int) int64
	// AtUInt returns the uint value of another column and given index.
	AtUInt(i, j int) uint64
	// AtFloat returns the float value of another column and given index.
	AtFloat(i, j int) float64
	// AtString returns the string value of another column and given index.
	AtString(i, j int) string
	// AtTime returns the time value of another column and given index.
	AtTime(i, j int) Time
}

type RowSelector

type RowSelector interface {
	NewBoolSelector() DoBoolRowSelector
	NewIntSelector() DoIntRowSelector
	NewUIntSelector() DoUIntRowSelector
	NewFloatSelector() DoFloatRowSelector
	NewStringSelector() DoStringRowSelector
}

type Rower

type Rower interface {
	Rows() []Row
}

type ScheduleFunc added in v0.0.3

type ScheduleFunc func(throughput int)

ScheduleFunc is a function that represents work to do. The throughput is the maximum number of messages to process for this scheduling.

type Source

type Source interface {
	Node
	Run(ctx context.Context)
}

func NewStorageSource

func NewStorageSource(id DatasetID, r StorageReader, readSpec ReadSpec, bounds Bounds, w Window, currentTime Time) Source

type StorageReader

type StorageReader interface {
	Read(ctx context.Context, trace map[string]string, rs ReadSpec, start, stop Time) (BlockIterator, error)
	Close()
}

func NewStorageReader

func NewStorageReader(hosts []string) (StorageReader, error)

type StringValueFunc

type StringValueFunc interface {
	ValueString() string
}

type Tags

type Tags map[string]string

func TagsForRow

func TagsForRow(i int, rr RowReader) Tags

func (Tags) Copy

func (t Tags) Copy() Tags

func (Tags) Equal

func (t Tags) Equal(o Tags) bool

func (Tags) IntersectingSubset

func (t Tags) IntersectingSubset(keys []string) Tags

func (Tags) Key

func (t Tags) Key() TagsKey

func (Tags) Keys

func (t Tags) Keys() []string

func (Tags) Subset

func (t Tags) Subset(keys []string) (Tags, bool)

Subset creates a new Tags that is a subset of t, using the list of keys. If a keys is provided that does not exist on t, then a subset is not possible and the boolean return value is false.

type TagsKey

type TagsKey string

func TagsToKey

func TagsToKey(order []string, t Tags) TagsKey

type Time

type Time int64

func Now

func Now() Time

func (Time) Add added in v0.0.4

func (t Time) Add(d Duration) Time

func (Time) Round

func (t Time) Round(d Duration) Time

func (Time) String

func (t Time) String() string

func (Time) Time

func (t Time) Time() time.Time

func (Time) Truncate

func (t Time) Truncate(d Duration) Time

type Transformation

type Transformation interface {
	RetractBlock(id DatasetID, meta BlockMetadata) error
	Process(id DatasetID, b Block) error
	UpdateWatermark(id DatasetID, t Time) error
	UpdateProcessingTime(id DatasetID, t Time) error
	Finish(id DatasetID, err error)
}

type Transport added in v0.0.3

type Transport interface {
	Transformation
	// Finished reports when the Transport has completed and there is no more work to do.
	Finished() <-chan struct{}
}

type Trigger

type Trigger interface {
	Triggered(TriggerContext) bool
	Finished() bool
	Reset()
}

func NewTriggerFromSpec

func NewTriggerFromSpec(spec query.TriggerSpec) Trigger

type TriggerContext

type TriggerContext struct {
	Block                 BlockContext
	Watermark             Time
	CurrentProcessingTime Time
}

type UIntValueFunc

type UIntValueFunc interface {
	ValueUInt() uint64
}

type UpdateProcessingTimeMsg

type UpdateProcessingTimeMsg interface {
	Message
	ProcessingTime() Time
}

type UpdateWatermarkMsg

type UpdateWatermarkMsg interface {
	Message
	WatermarkTime() Time
}

type ValueFunc

type ValueFunc interface {
	Type() DataType
}

type ValueIterator

type ValueIterator interface {
	DoBool(f func([]bool, RowReader))
	DoInt(f func([]int64, RowReader))
	DoUInt(f func([]uint64, RowReader))
	DoFloat(f func([]float64, RowReader))
	DoString(f func([]string, RowReader))
	DoTime(f func([]Time, RowReader))
}

type Window

type Window struct {
	Every  Duration
	Period Duration
	Round  Duration
	Start  Time
}

Directories

Path Synopsis
Package storage is a generated protocol buffer package.
Package storage is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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