Documentation
¶
Index ¶
- Constants
- func EnsureValueType(value tsm1.Value, expectedType influxql.DataType) (tsm1.Value, bool, error)
- func RegisterRule(name string, fn NewRuleFunc)
- type ChainingSet
- type Config
- type DropSerieRule
- func (r *DropSerieRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)
- func (r *DropSerieRule) CheckMode(check bool)
- func (r *DropSerieRule) End()
- func (r *DropSerieRule) EndShard() error
- func (r *DropSerieRule) EndTSM()
- func (r *DropSerieRule) EndWAL()
- func (r *DropSerieRule) Flags() int
- func (r *DropSerieRule) Start()
- func (r *DropSerieRule) StartShard(info storage.ShardInfo)
- func (r *DropSerieRule) StartTSM(path string)
- func (r *DropSerieRule) StartWAL(path string)
- func (r *DropSerieRule) WithLogger(logger *log.Logger)
- type DropSerieRuleConfiguration
- type NewRuleFunc
- type OldSerieRuleConfig
- type OldSeriesRule
- func (r *OldSeriesRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)
- func (r *OldSeriesRule) CheckMode(check bool)
- func (r *OldSeriesRule) End()
- func (r *OldSeriesRule) EndShard() error
- func (r *OldSeriesRule) EndTSM()
- func (r *OldSeriesRule) EndWAL()
- func (r *OldSeriesRule) Flags() int
- func (r *OldSeriesRule) Print(iow io.Writer)
- func (r *OldSeriesRule) Start()
- func (r *OldSeriesRule) StartShard(info storage.ShardInfo)
- func (r *OldSeriesRule) StartTSM(path string)
- func (r *OldSeriesRule) StartWAL(path string)
- func (r *OldSeriesRule) WithLogger(logger *log.Logger)
- type RenameFn
- type RenameMeasurementConfig
- type RenameMeasurementRule
- func (r *RenameMeasurementRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)
- func (r *RenameMeasurementRule) CheckMode(check bool)
- func (r *RenameMeasurementRule) Count() int
- func (r *RenameMeasurementRule) End()
- func (r *RenameMeasurementRule) EndShard() error
- func (r *RenameMeasurementRule) EndTSM()
- func (r *RenameMeasurementRule) EndWAL()
- func (r *RenameMeasurementRule) Flags() int
- func (r *RenameMeasurementRule) Start()
- func (r *RenameMeasurementRule) StartShard(info storage.ShardInfo)
- func (r *RenameMeasurementRule) StartTSM(path string)
- func (r *RenameMeasurementRule) StartWAL(path string)
- func (r *RenameMeasurementRule) WithLogger(logger *log.Logger)
- type Rule
- type Set
- type UpdateMeasurementFieldTypeRule
- func (r *UpdateMeasurementFieldTypeRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)
- func (r *UpdateMeasurementFieldTypeRule) CheckMode(check bool)
- func (r *UpdateMeasurementFieldTypeRule) End()
- func (r *UpdateMeasurementFieldTypeRule) EndShard() error
- func (r *UpdateMeasurementFieldTypeRule) EndTSM()
- func (r *UpdateMeasurementFieldTypeRule) EndWAL()
- func (r *UpdateMeasurementFieldTypeRule) Flags() int
- func (r *UpdateMeasurementFieldTypeRule) Start()
- func (r *UpdateMeasurementFieldTypeRule) StartShard(info storage.ShardInfo)
- func (r *UpdateMeasurementFieldTypeRule) StartTSM(path string)
- func (r *UpdateMeasurementFieldTypeRule) StartWAL(path string)
- func (r *UpdateMeasurementFieldTypeRule) WithLogger(logger *log.Logger)
- type UpdateTagValueRule
- func (r *UpdateTagValueRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)
- func (r *UpdateTagValueRule) CheckMode(check bool)
- func (r *UpdateTagValueRule) End()
- func (r *UpdateTagValueRule) EndShard() error
- func (r *UpdateTagValueRule) EndTSM()
- func (r *UpdateTagValueRule) EndWAL()
- func (r *UpdateTagValueRule) Flags() int
- func (r *UpdateTagValueRule) Start()
- func (r *UpdateTagValueRule) StartShard(info storage.ShardInfo)
- func (r *UpdateTagValueRule) StartTSM(path string)
- func (r *UpdateTagValueRule) StartWAL(path string)
- func (r *UpdateTagValueRule) WithLogger(logger *log.Logger)
Constants ¶
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 ¶
This section is empty.
Functions ¶
func EnsureValueType ¶
EnsureValueType casts a Value to a given data type
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
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) CheckMode ¶
func (r *DropSerieRule) CheckMode(check bool)
CheckMode sets the check mode on the rule
func (*DropSerieRule) EndShard ¶
func (r *DropSerieRule) EndShard() error
EndShard implements Rule interface
func (*DropSerieRule) StartShard ¶
func (r *DropSerieRule) StartShard(info storage.ShardInfo)
StartShard implements Rule interface
func (*DropSerieRule) StartTSM ¶
func (r *DropSerieRule) StartTSM(path string)
StartTSM implements Rule interface
func (*DropSerieRule) StartWAL ¶
func (r *DropSerieRule) StartWAL(path string)
StartWAL implements Rule interface
func (*DropSerieRule) WithLogger ¶
func (r *DropSerieRule) WithLogger(logger *log.Logger)
WithLogger sets the logger on the rule
type DropSerieRuleConfiguration ¶
DropSerieRuleConfiguration represents the toml configuration for DropSerieRule
func (*DropSerieRuleConfiguration) Build ¶
func (c *DropSerieRuleConfiguration) Build() (Rule, error)
Build implements the Config interface
func (*DropSerieRuleConfiguration) Sample ¶
func (c *DropSerieRuleConfiguration) 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 OldSerieRuleConfig ¶
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 OldSeriesRule ¶
type OldSeriesRule struct {
// contains filtered or unexported fields
}
OldSeriesRule defines a read-only rule to retrieve series that are oldest than a given timestamp
func NewOldSeriesRule ¶
NewOldSeriesRule creates a new OldSeriesRule
func (*OldSeriesRule) CheckMode ¶
func (r *OldSeriesRule) CheckMode(check bool)
CheckMode sets the check mode on the rule
func (*OldSeriesRule) EndShard ¶
func (r *OldSeriesRule) EndShard() error
EndShard implements Rule interface
func (*OldSeriesRule) Print ¶
func (r *OldSeriesRule) Print(iow io.Writer)
Print will print the list of series detected as old
func (*OldSeriesRule) StartShard ¶
func (r *OldSeriesRule) StartShard(info storage.ShardInfo)
StartShard implements Rule interface
func (*OldSeriesRule) StartTSM ¶
func (r *OldSeriesRule) StartTSM(path string)
StartTSM implements Rule interface
func (*OldSeriesRule) StartWAL ¶
func (r *OldSeriesRule) StartWAL(path string)
StartWAL implements Rule interface
func (*OldSeriesRule) WithLogger ¶
func (r *OldSeriesRule) WithLogger(logger *log.Logger)
WithLogger sets the logger on the rule
type RenameMeasurementConfig ¶
RenameMeasurementConfig represents the toml configuration for RenameMeasurementRule
func (*RenameMeasurementConfig) Build ¶
func (c *RenameMeasurementConfig) Build() (Rule, error)
Build implements Config interface
func (*RenameMeasurementConfig) Sample ¶
func (c *RenameMeasurementConfig) Sample() string
Sample implements Config interface
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(filter 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) 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)
StartShard implements Rule interface
func (*RenameMeasurementRule) StartTSM ¶
func (r *RenameMeasurementRule) StartTSM(path string)
StartTSM implements Rule interface
func (*RenameMeasurementRule) StartWAL ¶
func (r *RenameMeasurementRule) StartWAL(path string)
StartWAL implements Rule interface
func (*RenameMeasurementRule) WithLogger ¶
func (r *RenameMeasurementRule) WithLogger(logger *log.Logger)
WithLogger sets the logger on the rule
type Rule ¶
type Rule interface { CheckMode(check bool) Flags() int Start() End() StartShard(info storage.ShardInfo) EndShard() error StartTSM(path string) EndTSM() StartWAL(path string) 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 ¶
LoadConfig will load rules from a TOML configuration file
type UpdateMeasurementFieldTypeRule ¶
type UpdateMeasurementFieldTypeRule struct {
// contains filtered or unexported fields
}
UpdateMeasurementFieldTypeRule will update a field type for a given measurement
func NewUpdateMeasurementFieldType ¶
func NewUpdateMeasurementFieldType(measurement string, fieldKey string, fromType influxql.DataType, toType influxql.DataType) *UpdateMeasurementFieldTypeRule
NewUpdateMeasurementFieldType creates an UpdateMeasurementFieldTypeRule
func (*UpdateMeasurementFieldTypeRule) Apply ¶
func (r *UpdateMeasurementFieldTypeRule) Apply(key []byte, values []tsm1.Value) ([]byte, []tsm1.Value, error)
Apply implements Rule interface
func (*UpdateMeasurementFieldTypeRule) CheckMode ¶
func (r *UpdateMeasurementFieldTypeRule) CheckMode(check bool)
CheckMode sets the check mode on the rule
func (*UpdateMeasurementFieldTypeRule) End ¶
func (r *UpdateMeasurementFieldTypeRule) End()
End implements Rule interface
func (*UpdateMeasurementFieldTypeRule) EndShard ¶
func (r *UpdateMeasurementFieldTypeRule) EndShard() error
EndShard implements Rule interface
func (*UpdateMeasurementFieldTypeRule) EndTSM ¶
func (r *UpdateMeasurementFieldTypeRule) EndTSM()
EndTSM implements Rule interface
func (*UpdateMeasurementFieldTypeRule) EndWAL ¶
func (r *UpdateMeasurementFieldTypeRule) EndWAL()
EndWAL implements Rule interface
func (*UpdateMeasurementFieldTypeRule) Flags ¶
func (r *UpdateMeasurementFieldTypeRule) Flags() int
Flags implements Rule interface
func (*UpdateMeasurementFieldTypeRule) Start ¶
func (r *UpdateMeasurementFieldTypeRule) Start()
Start implements Rule interface
func (*UpdateMeasurementFieldTypeRule) StartShard ¶
func (r *UpdateMeasurementFieldTypeRule) StartShard(info storage.ShardInfo)
StartShard implements Rule interface
func (*UpdateMeasurementFieldTypeRule) StartTSM ¶
func (r *UpdateMeasurementFieldTypeRule) StartTSM(path string)
StartTSM implements Rule interface
func (*UpdateMeasurementFieldTypeRule) StartWAL ¶
func (r *UpdateMeasurementFieldTypeRule) StartWAL(path string)
StartWAL implements Rule interface
func (*UpdateMeasurementFieldTypeRule) WithLogger ¶
func (r *UpdateMeasurementFieldTypeRule) WithLogger(logger *log.Logger)
WithLogger sets the logger on the rule
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 NewUpdateTagValue ¶
func NewUpdateTagValue(measurement string, tagKey string, oldValue string, newValue string) *UpdateTagValueRule
NewUpdateTagValue creates a new UpdateTagValueRule
func (*UpdateTagValueRule) CheckMode ¶
func (r *UpdateTagValueRule) CheckMode(check bool)
CheckMode sets the check mode on the rule
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) 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)
StartShard implements Rule interface
func (*UpdateTagValueRule) StartTSM ¶
func (r *UpdateTagValueRule) StartTSM(path string)
StartTSM implements Rule interface
func (*UpdateTagValueRule) StartWAL ¶
func (r *UpdateTagValueRule) StartWAL(path string)
StartWAL implements Rule interface
func (*UpdateTagValueRule) WithLogger ¶
func (r *UpdateTagValueRule) WithLogger(logger *log.Logger)
WithLogger sets the logger on the rule