coordinator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DDLRetryInternalSecond      = 1
	DDLTimeOutSecond            = 30
	DMLRetryInternalMillisecond = 200
	DMLTimeOutSecond            = 30
)
View Source
const MaxShardKey = 64 * 1024

Variables

View Source
var ErrDatabaseNameRequired = errors.New("database name required")

ErrDatabaseNameRequired is returned when executing statements that require a database, when a database has not been provided.

Functions

This section is empty.

Types

type ClusterShardMapper

type ClusterShardMapper struct {
	//Node   *meta.Node
	Logger *logger.Logger
	// Remote execution timeout
	Timeout time.Duration
	meta.MetaClient
	NetStore  netstorage.Storage
	SeriesKey []byte
}

ClusterShardMapper implements a ShardMapper for Remote shards.

func (*ClusterShardMapper) Close

func (csm *ClusterShardMapper) Close() error

func (*ClusterShardMapper) GetSeriesKey

func (csm *ClusterShardMapper) GetSeriesKey() []byte

func (*ClusterShardMapper) MapShards

type ClusterShardMapping

type ClusterShardMapping struct {
	//Node        *meta.Node
	ShardMapper *ClusterShardMapper
	NetStore    netstorage.Storage

	MetaClient meta.MetaClient

	// Remote execution timeout
	Timeout time.Duration

	ShardMap map[Source]map[uint32][]uint64

	// MinTime is the minimum time that this shard mapper will allow.
	// Any attempt to use a time before this one will automatically result in using
	// this time instead.
	MinTime time.Time

	// MaxTime is the maximum time that this shard mapper will allow.
	// Any attempt to use a time after this one will automatically result in using
	// this time instead.
	MaxTime time.Time

	ShardsTimeRage influxql.TimeRange
	Logger         *logger.Logger
}

ClusterShardMapping maps data sources to a list of shard information.

func (*ClusterShardMapping) Close

func (csm *ClusterShardMapping) Close() error

Close clears out the list of mapped shards.

func (*ClusterShardMapping) CreateLogicalPlan

func (csm *ClusterShardMapping) CreateLogicalPlan(ctx context.Context, sources influxql.Sources, schema hybridqp.Catalog) (hybridqp.QueryNode, error)

func (*ClusterShardMapping) FieldDimensions

func (csm *ClusterShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, schema *influxql.Schema, err error)

func (*ClusterShardMapping) GetSources

func (csm *ClusterShardMapping) GetSources(sources influxql.Sources) influxql.Sources

func (*ClusterShardMapping) LogicalPlanCost

func (*ClusterShardMapping) MapType

func (*ClusterShardMapping) MapTypeBatch

func (csm *ClusterShardMapping) MapTypeBatch(m *influxql.Measurement, fields map[string]influxql.DataType, schema *influxql.Schema) error

func (*ClusterShardMapping) NodeNumbers

func (csm *ClusterShardMapping) NodeNumbers() int

func (*ClusterShardMapping) ShardsTimeRange

func (csm *ClusterShardMapping) ShardsTimeRange() influxql.TimeRange

type Columns

type Columns []string

define to sync.Pool

func (Columns) Len

func (columns Columns) Len() int

func (Columns) Less

func (columns Columns) Less(i, j int) bool

func (*Columns) Reset

func (f *Columns) Reset()

func (Columns) Swap

func (columns Columns) Swap(i, j int)

type IMetaExecutor

type IMetaExecutor interface {
	SetTimeOut(timeout time.Duration)
	EachDBNodes(database string, fn func(nodeID uint64, pts []uint32)) error
	Close() error
}

type MetaExecutor

type MetaExecutor struct {
	Logger     *logger.Logger
	MetaClient meta.MetaClient
	// contains filtered or unexported fields
}

MetaExecutor executes meta queries on all data nodes.

func NewMetaExecutor

func NewMetaExecutor() *MetaExecutor

NewMetaExecutor returns a new initialized *MetaExecutor.

func (*MetaExecutor) Close

func (m *MetaExecutor) Close() error

func (*MetaExecutor) EachDBNodes

func (m *MetaExecutor) EachDBNodes(database string, fn func(nodeID uint64, pts []uint32)) error

func (*MetaExecutor) SetTimeOut

func (m *MetaExecutor) SetTimeOut(timeout time.Duration)

type PointsWriter

type PointsWriter struct {
	MetaClient interface {
		Database(name string) (di *meta2.DatabaseInfo, err error)
		RetentionPolicy(database, policy string) (*meta2.RetentionPolicyInfo, error)
		CreateShardGroup(database, policy string, timestamp time.Time) (*meta2.ShardGroupInfo, error)
		DBPtView(database string) (meta2.DBPtInfos, error)
		Measurement(database string, rpName string, mstName string) (*meta2.MeasurementInfo, error)
		UpdateSchema(database string, retentionPolicy string, mst string, fieldToCreate []*proto2.FieldSchema) error
		CreateMeasurement(database string, retentionPolicy string, mst string, shardKey *meta2.ShardKeyInfo, indexR *meta2.IndexRelation) (*meta2.MeasurementInfo, error)
		GetAliveShards(database string, sgi *meta2.ShardGroupInfo) []int
	}

	TSDBStore interface {
		WriteRows(nodeID uint64, database, rp string, pt uint32, shard uint64, rows *[]influx.Row, timeout time.Duration) error
	}
	// contains filtered or unexported fields
}

PointsWriter handles writes across multiple local and remote data nodes.

func NewPointsWriter

func NewPointsWriter(timeout time.Duration) *PointsWriter

NewPointsWriter returns a new instance of PointsWriter for a node.

func (*PointsWriter) MapRowToShard

func (w *PointsWriter) MapRowToShard(shardrowmap *dictpool.Dict, ctx *injestionCtx, id string, r *influx.Row) error

func (*PointsWriter) WritePointRows

func (w *PointsWriter) WritePointRows(database, retentionPolicy string, rows []influx.Row) error

type ShowTagValuesExecutor

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

func NewShowTagValuesExecutor

func NewShowTagValuesExecutor(logger *logger.Logger, mc meta.MetaClient, me IMetaExecutor, store netstorage.Storage) *ShowTagValuesExecutor

func (*ShowTagValuesExecutor) Cardinality

func (e *ShowTagValuesExecutor) Cardinality(dimensions influxql.Dimensions)

func (*ShowTagValuesExecutor) Execute

type Source

type Source struct {
	Database        string
	RetentionPolicy string
}

Source contains the database and retention policy source for data.

type TagValuesSlice

type TagValuesSlice []netstorage.TableTagSets

func (TagValuesSlice) Len

func (a TagValuesSlice) Len() int

func (TagValuesSlice) Less

func (a TagValuesSlice) Less(i, j int) bool

func (TagValuesSlice) Swap

func (a TagValuesSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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