logical

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AndType uses values from left hand side for which there is a value in right hand side with exactly matching label sets.
	// Other elements are replaced by NaNs. The metric name and values are carried over from the left-hand side.
	AndType = "and"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AndNode

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

AndNode is a node for And operation

func (*AndNode) Process

func (c *AndNode) Process(lhs, rhs block.Block) (block.Block, error)

Process processes two logical blocks, performing And operation on them

type BaseNode

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

BaseNode is an execution node

func (*BaseNode) Process

func (c *BaseNode) Process(ID parser.NodeID, b block.Block) error

Process processes a block

type BaseOp

type BaseOp struct {
	OperatorType string
	LNode        parser.NodeID
	RNode        parser.NodeID
	Matching     *VectorMatching
	ReturnBool   bool
	ProcessorFn  MakeProcessor
}

BaseOp stores required properties for logical operations

func NewAndOp

func NewAndOp(lNode parser.NodeID, rNode parser.NodeID, matching *VectorMatching) BaseOp

NewAndOp creates a new And operation

func (BaseOp) Node

func (o BaseOp) Node(controller *transform.Controller) transform.OpNode

Node creates an execution node

func (BaseOp) OpType

func (o BaseOp) OpType() string

OpType for the operator

func (BaseOp) String

func (o BaseOp) String() string

String representation

type MakeProcessor

type MakeProcessor func(op BaseOp, controller *transform.Controller) Processor

MakeProcessor is a way to create a logical transform

type Processor

type Processor interface {
	Process(lhs block.Block, rhs block.Block) (block.Block, error)
}

Processor is implemented by each logical transform

func NewAndNode

func NewAndNode(op BaseOp, controller *transform.Controller) Processor

NewAndNode creates a new AndNode

type VectorMatchCardinality

type VectorMatchCardinality int

VectorMatchCardinality describes the cardinality relationship of two Vectors in a binary operation.

const (
	// CardOneToOne is used for one-one relationship
	CardOneToOne VectorMatchCardinality = iota
	// CardManyToOne is used for many-one relationship
	CardManyToOne
	// CardOneToMany is used for one-many relationship
	CardOneToMany
	// CardManyToMany is used for many-many relationship
	CardManyToMany
)

type VectorMatching

type VectorMatching struct {
	// The cardinality of the two Vectors.
	Card VectorMatchCardinality
	// MatchingLabels contains the labels which define equality of a pair of
	// elements from the Vectors.
	MatchingLabels []string
	// On includes the given label names from matching,
	// rather than excluding them.
	On bool
	// Include contains additional labels that should be included in
	// the result from the side with the lower cardinality.
	Include []string
}

VectorMatching describes how elements from two Vectors in a binary operation are supposed to be matched.

Jump to

Keyboard shortcuts

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