func (r *RenameMeasurementRule) StartShard(info storage.ShardInfo) bool {
	r.shard = info
	return true
}
StartShard implements Rule interface
package rules
import (
	"errors"
	"fmt"
	"log"
	"github.com/Abc-Arbitrage/infix/filter"
	"github.com/Abc-Arbitrage/infix/logging"
	"github.com/influxdata/influxdb/models"
	"github.com/influxdata/influxdb/tsdb/engine/tsm1"
	"github.com/Abc-Arbitrage/infix/storage"
)
var ErrMissingFromFilter = errors.New("missing from filter")
var ErrMissingRenameTo = errors.New("missing rename 'to'")
type RenameMeasurementRule struct {
	filter filter.Filter
	renameFn RenameFn
	renamed  map[string]string
	check  bool
	shard  storage.ShardInfo
	logger *log.Logger
}
type RenameMeasurementRuleConfig struct {
	From filter.Filter
	To   string
}
func NewRenameMeasurement(srcName string, dstName string) *RenameMeasurementRule {
	renameFn := func(measurement string) string {
		return dstName
	}
	filter := filter.NewIncludeFilter([]string{srcName})
	return NewRenameMeasurementWithFilter(filter, renameFn)
}
func NewRenameMeasurementWithPattern(pattern string, renameFn RenameFn) (*RenameMeasurementRule, error) {
	filter, err := filter.NewPatternFilter(pattern)
	if err != nil {
		return nil, err
	}
	return NewRenameMeasurementWithFilter(filter, renameFn), nil
}
func NewRenameMeasurementWithFilter(f filter.Filter, renameFn RenameFn) *RenameMeasurementRule {
	measurementFilter := filter.NewMeasurementFilter(f)
	return &RenameMeasurementRule{
		filter:   measurementFilter,
		renameFn: renameFn,
		renamed:  make(map[string]string),
		check:    false,
		logger:   logging.GetLogger("RenameMeasurementRule"),
	}
}
func (r *RenameMeasurementRule) CheckMode(check bool) {
	r.check = check
}
func (r *RenameMeasurementRule) Flags() int {
	return Standard
}
func (r *RenameMeasurementRule) WithLogger(logger *log.Logger) {
	r.logger = logger
}
func (r *RenameMeasurementRule) FilterKey(key []byte) bool {
	return r.filter.Filter(key)
}
func (r *RenameMeasurementRule) Start() {
}
func (r *RenameMeasurementRule) End() {
}