storage

package
v0.0.0-...-d500d3c Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package storage implements reading from a storage engine into a table as a data source.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSource

func NewSource(id execute.DatasetID, r Reader, readSpec ReadSpec, bounds execute.Bounds, w execute.Window, currentTime execute.Time) execute.Source

Types

type BucketLookup

type BucketLookup interface {
	Lookup(orgID platform.ID, name string) (platform.ID, bool)
}

type Dependencies

type Dependencies struct {
	Reader             Reader
	BucketLookup       BucketLookup
	OrganizationLookup OrganizationLookup
}

func (Dependencies) Validate

func (d Dependencies) Validate() error

type GroupMode

type GroupMode int
const (
	// GroupModeDefault specifies the default grouping mode, which is GroupModeAll.
	GroupModeDefault GroupMode = 0
	// GroupModeNone merges all series into a single group.
	GroupModeNone GroupMode = 1 << iota
	// GroupModeAll produces a separate table for each series.
	GroupModeAll
	// GroupModeBy produces a table for each unique value of the specified GroupKeys.
	GroupModeBy
	// GroupModeExcept produces a table for the unique values of all keys, except those specified by GroupKeys.
	GroupModeExcept
)

func ToGroupMode

func ToGroupMode(fluxMode functions.GroupMode) GroupMode

ToGroupMode accepts the group mode from Flux and produces the appropriate storage group mode.

type HostLookup

type HostLookup interface {
	Hosts() []string
	Watch() <-chan struct{}
}

type OrganizationLookup

type OrganizationLookup interface {
	Lookup(ctx context.Context, name string) (platform.ID, bool)
}

type ReadSpec

type ReadSpec struct {
	OrganizationID platform.ID
	BucketID       platform.ID

	RAMLimit     uint64
	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
	// GroupMode instructs
	GroupMode GroupMode
	// GroupKeys is the list of dimensions along which to group.
	//
	// When GroupMode is GroupModeBy, the results will be grouped by the specified keys.
	// When GroupMode is GroupModeExcept, the results will be grouped by all keys, except those specified.
	GroupKeys []string

	Database        string // required by InfluxDB OSS
	RetentionPolicy string // required by InfluxDB OSS
}

type Reader

type Reader interface {
	Read(ctx context.Context, rs ReadSpec, start, stop execute.Time) (flux.TableIterator, error)
	Close()
}

type StaticLookup

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

func NewStaticLookup

func NewStaticLookup(hosts []string) StaticLookup

func (StaticLookup) Hosts

func (l StaticLookup) Hosts() []string

func (StaticLookup) Watch

func (l StaticLookup) Watch() <-chan struct{}

Jump to

Keyboard shortcuts

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