agg

package module
v0.0.0-...-5d96a63 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 3 Imported by: 0

README

Aggregation algorithms for middleware

Actions Status Go Report Card

Algorithms based on "Optimal aggregation algorithms for middleware" by Fagin R, Lotem A, Naor M.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator func([]float64) float64

type Datum

type Datum interface {
	ID() interface{}
	Fields() []float64
}

func NRA

func NRA(fetcher Fetcher, agg Aggregator, k int, opts ...Option) ([]Datum, error)

type Fetcher

type Fetcher interface {
	// descending order
	ScanFields() []Iterator
	GetDatum(*Datum) error

	Merge(dst *Datum, src Datum)
}

type Iterator

type Iterator interface {
	Next(count int) ([]Datum, error)
	ValueRange() (min, max, missing float64)
}

type Option

type Option func(*options)

func WithBatchSize

func WithBatchSize(k int) Option

Jump to

Keyboard shortcuts

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