Documentation
¶
Index ¶
- Constants
- Variables
- type ClusterShardMapper
- type ClusterShardMapping
- func (csm *ClusterShardMapping) Close() error
- func (csm *ClusterShardMapping) CreateLogicalPlan(ctx context.Context, sources influxql.Sources, schema hybridqp.Catalog) (hybridqp.QueryNode, error)
- func (csm *ClusterShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, ...)
- func (csm *ClusterShardMapping) GetSources(sources influxql.Sources) influxql.Sources
- func (csm *ClusterShardMapping) LogicalPlanCost(m *influxql.Measurement, opt query.ProcessorOptions) (hybridqp.LogicalPlanCost, error)
- func (csm *ClusterShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType
- func (csm *ClusterShardMapping) MapTypeBatch(m *influxql.Measurement, fields map[string]influxql.DataType, ...) error
- func (csm *ClusterShardMapping) NodeNumbers() int
- func (csm *ClusterShardMapping) ShardsTimeRange() influxql.TimeRange
- type Columns
- type IMetaExecutor
- type MetaExecutor
- type PointsWriter
- type ShowTagValuesExecutor
- type Source
- type TagValuesSlice
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 ¶
func (csm *ClusterShardMapper) MapShards(sources influxql.Sources, t influxql.TimeRange, opt query.SelectOptions, condition influxql.Expr) (query.ShardGroup, error)
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 (*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 (csm *ClusterShardMapping) LogicalPlanCost(m *influxql.Measurement, opt query.ProcessorOptions) (hybridqp.LogicalPlanCost, error)
func (*ClusterShardMapping) MapType ¶
func (csm *ClusterShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType
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 IMetaExecutor ¶
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 (*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 ¶
func (e *ShowTagValuesExecutor) Execute(stmt *influxql.ShowTagValuesStatement) (models.Rows, error)
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)
Click to show internal directories.
Click to hide internal directories.