rules

package
v0.0.0-...-e035375 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TSMReadOnly is a flag for rules that should be read only for TSM files
	TSMReadOnly = 1
	// WALReadOnly is a flag for rules that should be read only for WAL files
	WALReadOnly = TSMReadOnly << 1

	// TSMWriteOnly is a flag for rules that should only write TSM files
	TSMWriteOnly = WALReadOnly << 1
	// WALWriteOnly is a flag for rules that should only write WAL files
	WALWriteOnly = TSMWriteOnly << 1

	// ReadOnly is a flag for rules that should be readonly only
	ReadOnly = TSMReadOnly | WALReadOnly

	// Standard is a flag for standard rules
	Standard = TSMWriteOnly | WALWriteOnly
)

Variables

View Source
var ErrMissingFieldFilter = errors.New("missing field filter")

ErrMissingFieldFilter is raised when a config is missing a field filter

View Source
var ErrMissingFromFilter = errors.New("missing from filter")

ErrMissingFromFilter is raised when a config is missing from filter

View Source
var ErrMissingMeasurementFilter = errors.New("missing measurement filter")

ErrMissingMeasurementFilter is raised when a config is missing a measurement filter

View Source
var ErrMissingRenameTo = errors.New("missing rename 'to'")

ErrMissingRenameTo is raised when a config is missing to

View Source
var ErrMissingTagFilter = errors.New("missing tag filter")

ErrMissingTagFilter is raised when a config is missing a tag filter

View Source
var ErrMissingTagKeyFilter = errors.New("missing tag key filter")

ErrMissingTagKeyFilter is raised when a config is missing a tag key filter

View Source
var ErrMissingTagValueFilter = errors.New("missing tag value filter")

ErrMissingTagValueFilter is raised when a config is missing a tag value filter

View Source
var ErrUnknownType = errors.New("unknown InfluxQL type")

ErrUnknownType is raised when failing to parse an InfluxQL Type

Functions

func EnsureValueType

func EnsureValueType(value tsm1.Value, expectedType influxql.DataType) (tsm1.Value, bool, error)

EnsureValueType casts a Value to a given data type

func PrintList

func PrintList(out io.Writer)

PrintList print a list of registered rules with a sample config

func RegisterRule

func RegisterRule(name string, fn NewRuleFunc)

RegisterRule registers a rule with the given name and config creation callback

Types

type ChainingSet

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

ChainingSet is a set of rules that are applied in chain

func NewChainingSet

func NewChainingSet(rules []Rule) *ChainingSet

NewChainingSet creates a new chaining set

func (*ChainingSet) Rules

func (c *ChainingSet) Rules() []Rule

Rules implement the Set interface

type Config

type Config interface {
	Sample() string

	Build() (Rule, error)
}

Config represents a configuration for a rule

func NewRule

func NewRule(name string) (Config, error)

NewRule creates a new rule configuration based on its registration name

type DropFieldRule

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

func NewDropField

func NewDropField(measurementFilter filter.Filter, fieldFilter filter.Filter, typeFilter filter.Filter) *DropFieldRule

func (*DropFieldRule) Apply

func (r *DropFieldRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

func (*DropFieldRule) CheckMode

func (r *DropFieldRule) CheckMode(check bool)

func (*DropFieldRule) End

func (r *DropFieldRule) End()

func (*DropFieldRule) EndShard

func (r *DropFieldRule) EndShard() error

func (*DropFieldRule) EndTSM

func (r *DropFieldRule) EndTSM()

func (*DropFieldRule) EndWAL

func (r *DropFieldRule) EndWAL()

func (*DropFieldRule) FilterKey

func (r *DropFieldRule) FilterKey(key []byte) bool

func (*DropFieldRule) Flags

func (r *DropFieldRule) Flags() int

func (*DropFieldRule) Start

func (r *DropFieldRule) Start()

func (*DropFieldRule) StartShard

func (r *DropFieldRule) StartShard(info storage.ShardInfo) bool

func (*DropFieldRule) StartTSM

func (r *DropFieldRule) StartTSM(path string) bool

func (*DropFieldRule) StartWAL

func (r *DropFieldRule) StartWAL(path string) bool

func (*DropFieldRule) WithLogger

func (r *DropFieldRule) WithLogger(logger *log.Logger)

type DropFieldRuleConfig

type DropFieldRuleConfig struct {
	Measurement filter.Filter
	Field       filter.Filter
	Type        filter.Filter
}

func (*DropFieldRuleConfig) Build

func (c *DropFieldRuleConfig) Build() (Rule, error)

func (*DropFieldRuleConfig) Sample

func (c *DropFieldRuleConfig) Sample() string

type DropMeasurementRule

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

DropMeasurementRule is a rule to drop measurements

func NewDropMeasurement

func NewDropMeasurement(srcName string) *DropMeasurementRule

NewDropMeasurement creates a new DropMeasurementRule to drop a single measurement

func NewDropMeasurementWithFilter

func NewDropMeasurementWithFilter(f filter.Filter) *DropMeasurementRule

NewDropMeasurementWithFilter creates a new DropMeasurementRule to rename measurements that uses the given filter

func NewDropMeasurementWithPattern

func NewDropMeasurementWithPattern(pattern string) (*DropMeasurementRule, error)

NewDropMeasurementWithPattern creates a new DropMeasurementRule to rename measurements that match the given pattern

func (*DropMeasurementRule) Apply

func (r *DropMeasurementRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*DropMeasurementRule) CheckMode

func (r *DropMeasurementRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*DropMeasurementRule) Count

func (r *DropMeasurementRule) Count() int

Count returns the number of measurements dropped

func (*DropMeasurementRule) End

func (r *DropMeasurementRule) End()

End implements Rule interface

func (*DropMeasurementRule) EndShard

func (r *DropMeasurementRule) EndShard() error

EndShard implements Rule interface

func (*DropMeasurementRule) EndTSM

func (r *DropMeasurementRule) EndTSM()

EndTSM implements Rule interface

func (*DropMeasurementRule) EndWAL

func (r *DropMeasurementRule) EndWAL()

EndWAL implements Rule interface

func (*DropMeasurementRule) FilterKey

func (r *DropMeasurementRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*DropMeasurementRule) Flags

func (r *DropMeasurementRule) Flags() int

Flags implements Rule interface

func (*DropMeasurementRule) Start

func (r *DropMeasurementRule) Start()

Start implements Rule interface

func (*DropMeasurementRule) StartShard

func (r *DropMeasurementRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*DropMeasurementRule) StartTSM

func (r *DropMeasurementRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*DropMeasurementRule) StartWAL

func (r *DropMeasurementRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*DropMeasurementRule) WithLogger

func (r *DropMeasurementRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type DropMeasurementRuleConfig

type DropMeasurementRuleConfig struct {
	DropFilter filter.Filter
}

DropMeasurementRuleConfig represents the toml configuration for DropMeasurementRule

func (*DropMeasurementRuleConfig) Build

func (c *DropMeasurementRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*DropMeasurementRuleConfig) Sample

func (c *DropMeasurementRuleConfig) Sample() string

Sample implements Config interface

type DropSerieRule

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

DropSerieRule defines a rule to drop series

func NewDropSerieRule

func NewDropSerieRule(dropFilter filter.Filter) *DropSerieRule

NewDropSerieRule creates a new DropSerieRule

func (*DropSerieRule) Apply

func (r *DropSerieRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*DropSerieRule) CheckMode

func (r *DropSerieRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*DropSerieRule) End

func (r *DropSerieRule) End()

End implements Rule interface

func (*DropSerieRule) EndShard

func (r *DropSerieRule) EndShard() error

EndShard implements Rule interface

func (*DropSerieRule) EndTSM

func (r *DropSerieRule) EndTSM()

EndTSM implements Rule interface

func (*DropSerieRule) EndWAL

func (r *DropSerieRule) EndWAL()

EndWAL implements Rule interface

func (*DropSerieRule) FilterKey

func (r *DropSerieRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*DropSerieRule) Flags

func (r *DropSerieRule) Flags() int

Flags implements Rule interface

func (*DropSerieRule) Start

func (r *DropSerieRule) Start()

Start implements Rule interface

func (*DropSerieRule) StartShard

func (r *DropSerieRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*DropSerieRule) StartTSM

func (r *DropSerieRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*DropSerieRule) StartWAL

func (r *DropSerieRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*DropSerieRule) WithLogger

func (r *DropSerieRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type DropSerieRuleConfig

type DropSerieRuleConfig struct {
	DropFilter filter.Filter
}

DropSerieRuleConfig represents the toml configuration for DropSerieRule

func (*DropSerieRuleConfig) Build

func (c *DropSerieRuleConfig) Build() (Rule, error)

Build implements the Config interface

func (*DropSerieRuleConfig) Sample

func (c *DropSerieRuleConfig) Sample() string

Sample implements the Config interface

type NewRuleFunc

type NewRuleFunc func() Config

NewRuleFunc represents a callback to register a rule's configuration to be able to load it from toml

type OldSerieRule

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

OldSerieRule defines a read-only rule to retrieve series that are oldest than a given timestamp

func NewOldSerieRule

func NewOldSerieRule(t time.Time, byField bool, out io.Writer, format string) (*OldSerieRule, error)

NewOldSerieRule creates a new OldSerieRule

func (*OldSerieRule) Apply

func (r *OldSerieRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*OldSerieRule) CheckMode

func (r *OldSerieRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*OldSerieRule) End

func (r *OldSerieRule) End()

End implements Rule interface

func (*OldSerieRule) EndShard

func (r *OldSerieRule) EndShard() error

EndShard implements Rule interface

func (*OldSerieRule) EndTSM

func (r *OldSerieRule) EndTSM()

EndTSM implements Rule interface

func (*OldSerieRule) EndWAL

func (r *OldSerieRule) EndWAL()

EndWAL implements Rule interface

func (*OldSerieRule) FilterKey

func (r *OldSerieRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*OldSerieRule) Flags

func (r *OldSerieRule) Flags() int

Flags implements Rule interface

func (*OldSerieRule) Print

func (r *OldSerieRule) Print(iow io.Writer)

Print will print the list of series detected as old

func (*OldSerieRule) Start

func (r *OldSerieRule) Start()

Start implements Rule interface

func (*OldSerieRule) StartShard

func (r *OldSerieRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*OldSerieRule) StartTSM

func (r *OldSerieRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*OldSerieRule) StartWAL

func (r *OldSerieRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*OldSerieRule) WithLogger

func (r *OldSerieRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type OldSerieRuleConfig

type OldSerieRuleConfig struct {
	Time            string
	ByField         bool
	Out             string
	Format          string
	Timestamp       bool
	TimestampLayout string
}

OldSerieRuleConfig represents the toml configuration for OldSerieRule

func (*OldSerieRuleConfig) Build

func (c *OldSerieRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*OldSerieRuleConfig) Sample

func (c *OldSerieRuleConfig) Sample() string

Sample implements Config interface

type RenameFieldRule

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

RenameFieldRule is a rule to rename a field from a given measurement

func NewRenameField

func NewRenameField(measurementFilter filter.Filter, fieldFilter filter.Filter, renameFn RenameFn) *RenameFieldRule

NewRenameField creates a new RenameFiled rule with given measurement and filter filters, will renamed fields according to renameFn

func (*RenameFieldRule) Apply

func (r *RenameFieldRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*RenameFieldRule) CheckMode

func (r *RenameFieldRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*RenameFieldRule) End

func (r *RenameFieldRule) End()

End implements Rule interface

func (*RenameFieldRule) EndShard

func (r *RenameFieldRule) EndShard() error

EndShard implements Rule interface

func (*RenameFieldRule) EndTSM

func (r *RenameFieldRule) EndTSM()

EndTSM implements Rule interface

func (*RenameFieldRule) EndWAL

func (r *RenameFieldRule) EndWAL()

EndWAL implements Rule interface

func (*RenameFieldRule) FilterKey

func (r *RenameFieldRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*RenameFieldRule) Flags

func (r *RenameFieldRule) Flags() int

Flags implements Rule interface

func (*RenameFieldRule) Start

func (r *RenameFieldRule) Start()

Start implements Rule interface

func (*RenameFieldRule) StartShard

func (r *RenameFieldRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*RenameFieldRule) StartTSM

func (r *RenameFieldRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*RenameFieldRule) StartWAL

func (r *RenameFieldRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*RenameFieldRule) WithLogger

func (r *RenameFieldRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type RenameFieldRuleConfig

type RenameFieldRuleConfig struct {
	Measurement filter.Filter
	Field       filter.Filter
	To          string
}

RenameFieldRuleConfig represents toml configuration a RenameField rule

func (*RenameFieldRuleConfig) Build

func (c *RenameFieldRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*RenameFieldRuleConfig) Sample

func (c *RenameFieldRuleConfig) Sample() string

Sample implements Config interface

type RenameFn

type RenameFn func(string) string

RenameFn defines a function to rename a measurement or field

func RenameFnFromFilter

func RenameFnFromFilter(f filter.Filter, to string) RenameFn

RenameFnFromFilter returns a RenameFn that expands captured variables from a pattern if the given filter is a PatternFilter

type RenameMeasurementRule

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

RenameMeasurementRule represents a rule to rename a measurement

func NewRenameMeasurement

func NewRenameMeasurement(srcName string, dstName string) *RenameMeasurementRule

NewRenameMeasurement creates a new RenameMeasurementRule to rename a single measurement

func NewRenameMeasurementWithFilter

func NewRenameMeasurementWithFilter(f filter.Filter, renameFn RenameFn) *RenameMeasurementRule

NewRenameMeasurementWithFilter creates a new RenameMeasurementRule to rename measurements that uses the given filter

func NewRenameMeasurementWithPattern

func NewRenameMeasurementWithPattern(pattern string, renameFn RenameFn) (*RenameMeasurementRule, error)

NewRenameMeasurementWithPattern creates a new RenameMeasurementRule to rename measurements that match the given pattern

func (*RenameMeasurementRule) Apply

func (r *RenameMeasurementRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*RenameMeasurementRule) CheckMode

func (r *RenameMeasurementRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*RenameMeasurementRule) Count

func (r *RenameMeasurementRule) Count() int

Count returns the number of measurements renamed

func (*RenameMeasurementRule) End

func (r *RenameMeasurementRule) End()

End implements Rule interface

func (*RenameMeasurementRule) EndShard

func (r *RenameMeasurementRule) EndShard() error

EndShard implements Rule interface

func (*RenameMeasurementRule) EndTSM

func (r *RenameMeasurementRule) EndTSM()

EndTSM implements Rule interface

func (*RenameMeasurementRule) EndWAL

func (r *RenameMeasurementRule) EndWAL()

EndWAL implements Rule interface

func (*RenameMeasurementRule) FilterKey

func (r *RenameMeasurementRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*RenameMeasurementRule) Flags

func (r *RenameMeasurementRule) Flags() int

Flags implements Rule interface

func (*RenameMeasurementRule) Start

func (r *RenameMeasurementRule) Start()

Start implements Rule interface

func (*RenameMeasurementRule) StartShard

func (r *RenameMeasurementRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*RenameMeasurementRule) StartTSM

func (r *RenameMeasurementRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*RenameMeasurementRule) StartWAL

func (r *RenameMeasurementRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*RenameMeasurementRule) WithLogger

func (r *RenameMeasurementRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type RenameMeasurementRuleConfig

type RenameMeasurementRuleConfig struct {
	From filter.Filter
	To   string
}

RenameMeasurementRuleConfig represents the toml configuration for RenameMeasurementRule

func (*RenameMeasurementRuleConfig) Build

func (c *RenameMeasurementRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*RenameMeasurementRuleConfig) Sample

func (c *RenameMeasurementRuleConfig) Sample() string

Sample implements Config interface

type RenameTagRule

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

RenameTagRule is a rule to rename a tag key

func NewRenameTagRule

func NewRenameTagRule(measurementFilter filter.Filter, tagFilter filter.Filter, renameFn RenameFn) *RenameTagRule

NewRenameTagRule creates a new RenameTagRule

func (*RenameTagRule) Apply

func (r *RenameTagRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*RenameTagRule) CheckMode

func (r *RenameTagRule) CheckMode(check bool)

CheckMode implements Rule interface

func (*RenameTagRule) End

func (r *RenameTagRule) End()

End implements Rule interface

func (*RenameTagRule) EndShard

func (r *RenameTagRule) EndShard() error

EndShard implements Rule interface

func (*RenameTagRule) EndTSM

func (r *RenameTagRule) EndTSM()

EndTSM implements Rule interface

func (*RenameTagRule) EndWAL

func (r *RenameTagRule) EndWAL()

EndWAL implements Rule interface

func (*RenameTagRule) FilterKey

func (r *RenameTagRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*RenameTagRule) Flags

func (r *RenameTagRule) Flags() int

Flags implements Rule interface

func (*RenameTagRule) Start

func (r *RenameTagRule) Start()

Start implements Rule interface

func (*RenameTagRule) StartShard

func (r *RenameTagRule) StartShard(shard storage.ShardInfo) bool

StartShard implements Rule interface

func (*RenameTagRule) StartTSM

func (r *RenameTagRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*RenameTagRule) StartWAL

func (r *RenameTagRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*RenameTagRule) WithLogger

func (r *RenameTagRule) WithLogger(logger *log.Logger)

WithLogger implements Rule interface

type RenameTagRuleConfig

type RenameTagRuleConfig struct {
	Measurement filter.Filter
	Tag         filter.Filter
	To          string
}

RenameTagRuleConfig represents the toml configuration of RenameTag rule

func (*RenameTagRuleConfig) Build

func (c *RenameTagRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*RenameTagRuleConfig) Sample

func (c *RenameTagRuleConfig) Sample() string

Sample implements Config interface

type Rule

type Rule interface {
	CheckMode(check bool)
	Flags() int

	FilterKey(key []byte) bool

	Start()
	End()

	StartShard(info storage.ShardInfo) bool
	EndShard() error

	StartTSM(path string) bool
	EndTSM()

	StartWAL(path string) bool
	EndWAL()

	Apply(key []byte, values []tsm1.Value) (newKey []byte, newValues []tsm1.Value, err error)
}

Rule represents a rule to apply to a given TSM or WAL entry

func LoadConfig

func LoadConfig(path string) ([]Rule, error)

LoadConfig will load rules from a TOML configuration file

type Set

type Set interface {
	Rules() []Rule
}

Set defines a set of rules to apply

type ShowFieldKeyMultipleTypesConfig

type ShowFieldKeyMultipleTypesConfig struct {
	Measurement filter.Filter
	Field       filter.Filter
}

ShowFieldKeyMultipleTypesConfig represents the toml configuration for ShowFieldKeyMultipleTypesRule

func (*ShowFieldKeyMultipleTypesConfig) Build

Build implements Config interface

func (*ShowFieldKeyMultipleTypesConfig) Sample

Sample implements Config interface

type ShowFieldKeyMultipleTypesRule

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

ShowFieldKeyMultipleTypesRule is a rule to show fields on measurements that have different data type along shards

func NewShowFieldKeyMultipleTypes

func NewShowFieldKeyMultipleTypes(measurementFilter filter.Filter, fieldFilter filter.Filter) *ShowFieldKeyMultipleTypesRule

NewShowFieldKeyMultipleTypes creates an ShowFieldKeyMultipleTypesRule

func (*ShowFieldKeyMultipleTypesRule) Apply

func (r *ShowFieldKeyMultipleTypesRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) CheckMode

func (r *ShowFieldKeyMultipleTypesRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*ShowFieldKeyMultipleTypesRule) End

End implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) EndShard

func (r *ShowFieldKeyMultipleTypesRule) EndShard() error

EndShard implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) EndTSM

func (r *ShowFieldKeyMultipleTypesRule) EndTSM()

EndTSM implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) EndWAL

func (r *ShowFieldKeyMultipleTypesRule) EndWAL()

EndWAL implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) FilterKey

func (r *ShowFieldKeyMultipleTypesRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) Flags

Flags implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) Start

func (r *ShowFieldKeyMultipleTypesRule) Start()

Start implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) StartShard

StartShard implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) StartTSM

func (r *ShowFieldKeyMultipleTypesRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) StartWAL

func (r *ShowFieldKeyMultipleTypesRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*ShowFieldKeyMultipleTypesRule) WithLogger

func (r *ShowFieldKeyMultipleTypesRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type UpdateFieldTypeRule

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

UpdateFieldTypeRule will update a field type for a given measurement

func NewUpdateFieldType

func NewUpdateFieldType(measurementFilter filter.Filter, fieldFilter filter.Filter, fromType influxql.DataType, toType influxql.DataType) *UpdateFieldTypeRule

NewUpdateFieldType creates an UpdateFieldTypeRule

func (*UpdateFieldTypeRule) Apply

func (r *UpdateFieldTypeRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*UpdateFieldTypeRule) CheckMode

func (r *UpdateFieldTypeRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*UpdateFieldTypeRule) End

func (r *UpdateFieldTypeRule) End()

End implements Rule interface

func (*UpdateFieldTypeRule) EndShard

func (r *UpdateFieldTypeRule) EndShard() error

EndShard implements Rule interface

func (*UpdateFieldTypeRule) EndTSM

func (r *UpdateFieldTypeRule) EndTSM()

EndTSM implements Rule interface

func (*UpdateFieldTypeRule) EndWAL

func (r *UpdateFieldTypeRule) EndWAL()

EndWAL implements Rule interface

func (*UpdateFieldTypeRule) FilterKey

func (r *UpdateFieldTypeRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*UpdateFieldTypeRule) Flags

func (r *UpdateFieldTypeRule) Flags() int

Flags implements Rule interface

func (*UpdateFieldTypeRule) Start

func (r *UpdateFieldTypeRule) Start()

Start implements Rule interface

func (*UpdateFieldTypeRule) StartShard

func (r *UpdateFieldTypeRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*UpdateFieldTypeRule) StartTSM

func (r *UpdateFieldTypeRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*UpdateFieldTypeRule) StartWAL

func (r *UpdateFieldTypeRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*UpdateFieldTypeRule) WithLogger

func (r *UpdateFieldTypeRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type UpdateFieldTypeRuleConfig

type UpdateFieldTypeRuleConfig struct {
	Measurement filter.Filter
	Field       filter.Filter

	FromType string
	ToType   string
}

UpdateFieldTypeRuleConfig represents the toml configuration for UpdateFieldTypeRule

func (*UpdateFieldTypeRuleConfig) Build

func (c *UpdateFieldTypeRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*UpdateFieldTypeRuleConfig) Sample

func (c *UpdateFieldTypeRuleConfig) Sample() string

Sample implements Config interface

type UpdateTagValueRule

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

UpdateTagValueRule defines a rule to update the value of a tag for a given measurement

func NewUpdateTagValueRule

func NewUpdateTagValueRule(measurementFilter filter.Filter, keyFilter filter.Filter, valueFilter filter.Filter, renameFn RenameFn) *UpdateTagValueRule

NewUpdateTagValueRule creates a new UpdateTagValueRule

func (*UpdateTagValueRule) Apply

func (r *UpdateTagValueRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)

Apply implements Rule interface

func (*UpdateTagValueRule) CheckMode

func (r *UpdateTagValueRule) CheckMode(check bool)

CheckMode sets the check mode on the rule

func (*UpdateTagValueRule) End

func (r *UpdateTagValueRule) End()

End implements Rule interface

func (*UpdateTagValueRule) EndShard

func (r *UpdateTagValueRule) EndShard() error

EndShard implements Rule interface

func (*UpdateTagValueRule) EndTSM

func (r *UpdateTagValueRule) EndTSM()

EndTSM implements Rule interface

func (*UpdateTagValueRule) EndWAL

func (r *UpdateTagValueRule) EndWAL()

EndWAL implements Rule interface

func (*UpdateTagValueRule) FilterKey

func (r *UpdateTagValueRule) FilterKey(key []byte) bool

FilterKey implements Rule interface

func (*UpdateTagValueRule) Flags

func (r *UpdateTagValueRule) Flags() int

Flags implements Rule interface

func (*UpdateTagValueRule) Start

func (r *UpdateTagValueRule) Start()

Start implements Rule interface

func (*UpdateTagValueRule) StartShard

func (r *UpdateTagValueRule) StartShard(info storage.ShardInfo) bool

StartShard implements Rule interface

func (*UpdateTagValueRule) StartTSM

func (r *UpdateTagValueRule) StartTSM(path string) bool

StartTSM implements Rule interface

func (*UpdateTagValueRule) StartWAL

func (r *UpdateTagValueRule) StartWAL(path string) bool

StartWAL implements Rule interface

func (*UpdateTagValueRule) WithLogger

func (r *UpdateTagValueRule) WithLogger(logger *log.Logger)

WithLogger sets the logger on the rule

type UpdateTagValueRuleConfig

type UpdateTagValueRuleConfig struct {
	Measurement filter.Filter
	Key         filter.Filter
	Value       filter.Filter
	To          string
}

UpdateTagValueRuleConfig represents the toml configuration of UpdateTagValue rule

func (*UpdateTagValueRuleConfig) Build

func (c *UpdateTagValueRuleConfig) Build() (Rule, error)

Build implements Config interface

func (*UpdateTagValueRuleConfig) Sample

func (c *UpdateTagValueRuleConfig) Sample() string

Sample implements Config interface

Jump to

Keyboard shortcuts

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