measure

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package measure implements execution operations for querying measure data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze added in v0.3.0

func Analyze(_ context.Context, criteria *measurev1.QueryRequest, metadata *commonv1.Metadata, s logical.Schema) (logical.Plan, error)

Analyze converts logical expressions to executable operation tree represented by Plan.

func BuildSchema added in v0.3.0

func BuildSchema(md *databasev1.Measure, indexRules []*databasev1.IndexRule) (logical.Schema, error)

BuildSchema returns Schema loaded from the metadata repository.

func DistributedAnalyze added in v0.5.0

func DistributedAnalyze(criteria *measurev1.QueryRequest, s logical.Schema) (logical.Plan, error)

DistributedAnalyze converts logical expressions to executable operation tree represented by Plan.

Types

type TopElement

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

TopElement seals a sortable value and its data point which this value belongs to.

func NewTopElement

func NewTopElement(dp *measurev1.DataPoint, value int64) TopElement

NewTopElement returns a TopElement.

func (TopElement) Val

func (e TopElement) Val() int64

Val returns the sortable value.

type TopQueue

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

TopQueue is a sortable queue only keeps top-n members when pushed new elements.

func NewTopQueue

func NewTopQueue(n int, reverted bool) *TopQueue

NewTopQueue returns a new TopQueue.

func (*TopQueue) Elements

func (s *TopQueue) Elements() []TopElement

Elements returns all elements accepted by the queue.

func (*TopQueue) Equal

func (s *TopQueue) Equal(other *TopQueue) bool

Equal reports whether s and other have the queue's max acceptable number and sorting order.

func (*TopQueue) Insert

func (s *TopQueue) Insert(element TopElement) bool

Insert pushes a new element to the queue. It returns true if the element are accepted by the queue, returns false if it's evicted.

func (*TopQueue) Purge

func (s *TopQueue) Purge()

Purge resets the queue.

func (TopQueue) String

func (s TopQueue) String() string

Strings shows the string represent.

Jump to

Keyboard shortcuts

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