functor

package
v0.0.0-...-696fb74 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Averager

type Averager struct {
	Count int64
	Sum   float64
	// contains filtered or unexported fields
}

func (*Averager) Init

func (f *Averager) Init(typ *grizzly.FieldType)

func (*Averager) Reset

func (f *Averager) Reset()

func (*Averager) Update

func (f *Averager) Update(value interface{})

func (*Averager) Value

func (f *Averager) Value() interface{}

type Counter

type Counter struct {
	Count int64
}

func (*Counter) Init

func (f *Counter) Init(typ *grizzly.FieldType)

func (*Counter) Reset

func (f *Counter) Reset()

func (*Counter) Update

func (f *Counter) Update(ignoreMe interface{})

func (*Counter) Value

func (f *Counter) Value() interface{}

type DistinctCounter

type DistinctCounter struct {
	TheType     grizzly.FieldType
	Counts      map[uint32]int
	NumDistinct int
}

func (*DistinctCounter) Init

func (f *DistinctCounter) Init(typ *grizzly.FieldType)

func (*DistinctCounter) Reset

func (f *DistinctCounter) Reset()

func (*DistinctCounter) Update

func (f *DistinctCounter) Update(value interface{})

func (*DistinctCounter) Value

func (f *DistinctCounter) Value() interface{}

type First

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

func (*First) Init

func (f *First) Init(typ *grizzly.FieldType)

func (*First) Reset

func (f *First) Reset()

func (*First) Update

func (f *First) Update(value interface{})

func (*First) Value

func (f *First) Value() interface{}

type Functor

type Functor interface {
	Init(typ *grizzly.FieldType)
	Reset()
	Update(value interface{})
	Value() interface{}
}

Functor embodies an aggregate function. It typically has an internal state that is 1. intialized before the first row is processed 2. updated by using information from a row 3. read by calling `Value` 4. Reset at the window boundary to be ready to aggregate the next values from the upcoming window.

type Last

type Last struct {
	Last interface{}
}

func (*Last) Init

func (f *Last) Init(typ *grizzly.FieldType)

func (*Last) Reset

func (f *Last) Reset()

func (*Last) Update

func (f *Last) Update(value interface{})

func (*Last) Value

func (f *Last) Value() interface{}

type Maximizer

type Maximizer struct {
	TheType grizzly.FieldType
	Maximum interface{}
}

func (*Maximizer) Init

func (f *Maximizer) Init(typ *grizzly.FieldType)

func (*Maximizer) Reset

func (f *Maximizer) Reset()

func (*Maximizer) Update

func (f *Maximizer) Update(value interface{})

func (*Maximizer) Value

func (f *Maximizer) Value() interface{}

type Minimizer

type Minimizer struct {
	TheType grizzly.FieldType
	Minimum interface{}
}

func (*Minimizer) Init

func (f *Minimizer) Init(typ *grizzly.FieldType)

func (*Minimizer) Reset

func (f *Minimizer) Reset()

func (*Minimizer) Update

func (f *Minimizer) Update(value interface{})

func (*Minimizer) Value

func (f *Minimizer) Value() interface{}

type NoOp

type NoOp struct {
	TheType  grizzly.FieldType
	TheValue interface{}
}

func (*NoOp) Init

func (f *NoOp) Init(typ *grizzly.FieldType)

func (*NoOp) Reset

func (f *NoOp) Reset()

func (*NoOp) Update

func (f *NoOp) Update(value interface{})

func (*NoOp) Value

func (f *NoOp) Value() interface{}

type Summer

type Summer struct {
	TheType grizzly.FieldType
	Sum     float64
}

func (*Summer) Init

func (f *Summer) Init(typ *grizzly.FieldType)

func (*Summer) Reset

func (f *Summer) Reset()

func (*Summer) Update

func (f *Summer) Update(value interface{})

func (*Summer) Value

func (f *Summer) Value() interface{}

type Uniquer

type Uniquer struct {
	TheType grizzly.FieldType
	HLL     *hll.HyperLogLog
}

func (*Uniquer) Init

func (f *Uniquer) Init(typ *grizzly.FieldType)

func (*Uniquer) Reset

func (f *Uniquer) Reset()

func (*Uniquer) Update

func (f *Uniquer) Update(value interface{})

func (*Uniquer) Value

func (f *Uniquer) Value() interface{}

Jump to

Keyboard shortcuts

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