Documentation ¶
Overview ¶
Package coordinator contains abstractions for writing points, executing statements, and accessing meta data.
Index ¶
- Constants
- Variables
- func DatabaseShards(c interface{ ... }, db string) ([]meta.ShardInfo, error)
- func DecodeLV(r io.Reader, v encoding.BinaryUnmarshaler) error
- func DecodeTLV(r io.Reader, v encoding.BinaryUnmarshaler) (typ byte, err error)
- func EncodeLV(w io.Writer, v encoding.BinaryMarshaler) error
- func EncodeTLV(w io.Writer, typ byte, v encoding.BinaryMarshaler) error
- func GetShardInfoByIds(MetaClient interface{ ... }, ids []uint64) ([]meta.ShardInfo, error)
- func IsRetryable(err error) bool
- func NewBoundedPool(initialCap, maxCap int, timeout time.Duration, factory Factory) (pool.Pool, error)
- func ReadLV(r io.Reader) ([]byte, error)
- func ReadTLV(r io.Reader) (byte, []byte, error)
- func ReadType(r io.Reader) (byte, error)
- func RequestAndParseResponse(url string, data interface{}, resp interface{}) error
- func WriteLV(w io.Writer, buf []byte) error
- func WriteTLV(w io.Writer, typ byte, buf []byte) error
- func WriteType(w io.Writer, typ byte) error
- type ClusterExecutor
- func (me *ClusterExecutor) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions, ...) (query.Iterator, error)
- func (me *ClusterExecutor) DeleteDatabase(database string) error
- func (me *ClusterExecutor) DeleteMeasurement(database, name string) error
- func (me *ClusterExecutor) DeleteSeries(database string, sources []influxql.Source, cond influxql.Expr) error
- func (me *ClusterExecutor) ExecuteStatement(stmt influxql.Statement, ctx *query.ExecutionContext) error
- func (me *ClusterExecutor) FieldDimensions(m *influxql.Measurement, shards []meta.ShardInfo) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
- func (me *ClusterExecutor) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.IteratorCost, error)
- func (me *ClusterExecutor) MapType(m *influxql.Measurement, field string, shards []meta.ShardInfo) influxql.DataType
- func (me *ClusterExecutor) MeasurementNames(auth query.Authorizer, database string, cond influxql.Expr) ([][]byte, error)
- func (me *ClusterExecutor) SeriesCardinality(database string) (int64, error)
- func (me *ClusterExecutor) TagKeys(auth query.Authorizer, ids []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error)
- func (me *ClusterExecutor) TagValues(auth query.Authorizer, ids []uint64, cond influxql.Expr) ([]tsdb.TagValues, error)
- func (me *ClusterExecutor) WithLogger(log *zap.Logger)
- type ClusterMetaClient
- func (me *ClusterMetaClient) AcquireLease(name string) (*meta.Lease, error)
- func (me *ClusterMetaClient) AddShardOwner(shardID, nodeID uint64) error
- func (me *ClusterMetaClient) AdminUserExists() bool
- func (me *ClusterMetaClient) Authenticate(username, password string) (meta.User, error)
- func (me *ClusterMetaClient) ClusterID() uint64
- func (me *ClusterMetaClient) CreateContinuousQuery(database, name, query string) error
- func (me *ClusterMetaClient) CreateDataNode(httpAddr, tcpAddr string) (*meta.NodeInfo, error)
- func (me *ClusterMetaClient) CreateDatabase(name string) (*meta.DatabaseInfo, error)
- func (me *ClusterMetaClient) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error)
- func (me *ClusterMetaClient) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error)
- func (me *ClusterMetaClient) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)
- func (me *ClusterMetaClient) CreateSubscription(database, rp, name, mode string, destinations []string) error
- func (me *ClusterMetaClient) CreateUser(name, password string, admin bool) (meta.User, error)
- func (me *ClusterMetaClient) DataNode(id uint64) (*meta.NodeInfo, error)
- func (me *ClusterMetaClient) DataNodeByTCPHost(addr string) (*meta.NodeInfo, error)
- func (me *ClusterMetaClient) DataNodes() ([]meta.NodeInfo, error)
- func (me *ClusterMetaClient) Database(name string) *meta.DatabaseInfo
- func (me *ClusterMetaClient) Databases() []meta.DatabaseInfo
- func (me *ClusterMetaClient) DeleteDataNode(id uint64) error
- func (me *ClusterMetaClient) DeleteShardGroup(database, policy string, id uint64) error
- func (me *ClusterMetaClient) DropContinuousQuery(database, name string) error
- func (me *ClusterMetaClient) DropDatabase(name string) error
- func (me *ClusterMetaClient) DropRetentionPolicy(database, name string) error
- func (me *ClusterMetaClient) DropShard(id uint64) error
- func (me *ClusterMetaClient) DropSubscription(database, rp, name string) error
- func (me *ClusterMetaClient) DropUser(name string) error
- func (me *ClusterMetaClient) MarshalBinary() ([]byte, error)
- func (me *ClusterMetaClient) Open() error
- func (me *ClusterMetaClient) PrecreateShardGroups(from, to time.Time) error
- func (me *ClusterMetaClient) PruneShardGroups() error
- func (me *ClusterMetaClient) RemoveShardOwner(shardID, nodeID uint64) error
- func (me *ClusterMetaClient) RetentionPolicy(database, name string) (*meta.RetentionPolicyInfo, error)
- func (me *ClusterMetaClient) RunSyncLoop()
- func (me *ClusterMetaClient) SetAdminPrivilege(username string, admin bool) error
- func (me *ClusterMetaClient) SetPrivilege(username, database string, p influxql.Privilege) error
- func (me *ClusterMetaClient) ShardGroupsByTimeRange(database, policy string, min, max time.Time) ([]meta.ShardGroupInfo, error)
- func (me *ClusterMetaClient) ShardIDs() []uint64
- func (me *ClusterMetaClient) ShardOwner(id uint64) (string, string, *meta.ShardGroupInfo)
- func (me *ClusterMetaClient) TruncateShardGroups(t time.Time) error
- func (me *ClusterMetaClient) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error
- func (me *ClusterMetaClient) UpdateUser(name, password string) error
- func (me *ClusterMetaClient) User(name string) (meta.User, error)
- func (me *ClusterMetaClient) UserCount() int
- func (me *ClusterMetaClient) UserPrivilege(username, database string) (*influxql.Privilege, error)
- func (me *ClusterMetaClient) UserPrivileges(username string) (map[string]influxql.Privilege, error)
- func (me *ClusterMetaClient) Users() []meta.UserInfo
- func (me *ClusterMetaClient) WaitForDataChanged() chan struct{}
- func (me *ClusterMetaClient) WithLogger(log *zap.Logger)
- type ClusterShardMapper
- type ClusterShardMapping
- func (a *ClusterShardMapping) Close() error
- func (a *ClusterShardMapping) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error)
- func (a *ClusterShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
- func (a *ClusterShardMapping) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error)
- func (a *ClusterShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType
- type Config
- type CreateIteratorRequest
- type CreateIteratorResponse
- type DeleteDatabaseRequest
- type DeleteDatabaseResponse
- type DeleteMeasurementRequest
- type DeleteMeasurementResponse
- type DeleteSeriesRequest
- type DeleteSeriesRequestProto
- type DeleteSeriesResponse
- type ExecuteStatementRequest
- func (r *ExecuteStatementRequest) Database() string
- func (r *ExecuteStatementRequest) MarshalBinary() ([]byte, error)
- func (r *ExecuteStatementRequest) SetDatabase(database string)
- func (r *ExecuteStatementRequest) SetStatement(statement string)
- func (r *ExecuteStatementRequest) Statement() string
- func (r *ExecuteStatementRequest) UnmarshalBinary(buf []byte) error
- type ExecuteStatementResponse
- func (w *ExecuteStatementResponse) Code() int
- func (w *ExecuteStatementResponse) MarshalBinary() ([]byte, error)
- func (w *ExecuteStatementResponse) Message() string
- func (w *ExecuteStatementResponse) SetCode(code int)
- func (w *ExecuteStatementResponse) SetMessage(message string)
- func (w *ExecuteStatementResponse) UnmarshalBinary(buf []byte) error
- type Factory
- type FieldDimensionsRequest
- type FieldDimensionsResponse
- type InternalServiceStatistics
- type IteartorCostRequestProto
- type IteratorCostRequest
- type IteratorCostResponse
- type LocalTSDBStore
- type MapTypeRequest
- type MapTypeRequestProto
- type MapTypeResponse
- type Measurement
- type MeasurementNamesProto
- type MeasurementNamesRequest
- type MeasurementNamesResponse
- type MetaClient
- type MetaClientImpl
- func (me *MetaClientImpl) AcquireLease(NodeID uint64, name string) (*meta.Lease, error)
- func (me *MetaClientImpl) AddShardOwner(shardID, nodeID uint64) error
- func (me *MetaClientImpl) Authenticate(username, password string) (meta.User, error)
- func (me *MetaClientImpl) ClusterID() uint64
- func (me *MetaClientImpl) CreateContinuousQuery(database, name, query string) error
- func (me *MetaClientImpl) CreateDataNode(httpAddr, tcpAddr string) (*meta.NodeInfo, error)
- func (me *MetaClientImpl) CreateDatabase(name string) (*meta.DatabaseInfo, error)
- func (me *MetaClientImpl) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error)
- func (me *MetaClientImpl) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error)
- func (me *MetaClientImpl) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)
- func (me *MetaClientImpl) CreateSubscription(database, rp, name, mode string, destinations []string) error
- func (me *MetaClientImpl) CreateUser(name, password string, admin bool) (meta.User, error)
- func (me *MetaClientImpl) Data() (*imeta.Data, error)
- func (me *MetaClientImpl) DeleteDataNode(id uint64) error
- func (me *MetaClientImpl) DeleteShardGroup(database, policy string, id uint64) error
- func (me *MetaClientImpl) DropContinuousQuery(database, name string) error
- func (me *MetaClientImpl) DropDatabase(name string) error
- func (me *MetaClientImpl) DropRetentionPolicy(database, name string) error
- func (me *MetaClientImpl) DropShard(id uint64) error
- func (me *MetaClientImpl) DropSubscription(database, rp, name string) error
- func (me *MetaClientImpl) DropUser(name string) error
- func (me *MetaClientImpl) Ping() (uint64, error)
- func (me *MetaClientImpl) PrecreateShardGroups(from, to time.Time) error
- func (me *MetaClientImpl) PruneShardGroups() error
- func (me *MetaClientImpl) RemoveShardOwner(shardID, nodeID uint64) error
- func (me *MetaClientImpl) SetAdminPrivilege(username string, admin bool) error
- func (me *MetaClientImpl) SetPrivilege(username, database string, p influxql.Privilege) error
- func (me *MetaClientImpl) TruncateShardGroups(t time.Time) error
- func (me *MetaClientImpl) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error
- func (me *MetaClientImpl) UpdateUser(name, password string) error
- func (me *MetaClientImpl) Url(path string) string
- type Node2ShardIDs
- type NodeDialer
- type NodeIds
- type PointsWriter
- func (w *PointsWriter) AddWriteSubscriber(c chan<- *WritePointsRequest)
- func (w *PointsWriter) Close() error
- func (w *PointsWriter) MapShards(wp *WritePointsRequest) (*ShardMapping, error)
- func (w *PointsWriter) Open() error
- func (w *PointsWriter) Statistics(tags map[string]string) []models.Statistic
- func (w *PointsWriter) WithLogger(log *zap.Logger)
- func (w *PointsWriter) WritePoints(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, ...) error
- func (w *PointsWriter) WritePointsInto(p *influxdb_coordinator.IntoWriteRequest) error
- func (w *PointsWriter) WritePointsPrivileged(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, ...) error
- type RemoteNodeExecutor
- type SeriesCardinalityRequest
- type SeriesCardinalityResponse
- type Service
- type ShardMapping
- type ShardWriter
- type Source
- type StringSlice
- type TSDBStore
- type TagKeysProto
- type TagKeysRequest
- type TagKeysResponse
- type TagValuesRequest
- type TagValuesResponse
- type TaskManagerStatementRequest
- type TaskManagerStatementRespProto
- type TaskManagerStatementResponse
- type WritePointsRequest
- type WriteShardRequest
- func (w *WriteShardRequest) AddPoint(name string, value interface{}, timestamp time.Time, tags models.Tags)
- func (w *WriteShardRequest) AddPoints(points []models.Point)
- func (w *WriteShardRequest) Database() string
- func (w *WriteShardRequest) MarshalBinary() ([]byte, error)
- func (w *WriteShardRequest) Points() []models.Point
- func (w *WriteShardRequest) RetentionPolicy() string
- func (w *WriteShardRequest) SetDatabase(db string)
- func (w *WriteShardRequest) SetRetentionPolicy(rp string)
- func (w *WriteShardRequest) SetShardID(id uint64)
- func (w *WriteShardRequest) ShardID() uint64
- func (w *WriteShardRequest) UnmarshalBinary(buf []byte) error
- type WriteShardResponse
- func (w *WriteShardResponse) Code() int
- func (w *WriteShardResponse) MarshalBinary() ([]byte, error)
- func (w *WriteShardResponse) Message() string
- func (w *WriteShardResponse) SetCode(code int)
- func (w *WriteShardResponse) SetMessage(message string)
- func (w *WriteShardResponse) UnmarshalBinary(buf []byte) error
- type WriteStatistics
Constants ¶
const ( // DefaultWriteTimeout is the default timeout for a complete write to succeed. DefaultWriteTimeout = 10 * time.Second DefaultDialTimeout = 1 * time.Second DefaultPoolMaxIdleTimeout = 60 * time.Second DefaultShardReaderTimeout = 600 * time.Second // DefaultMaxConcurrentQueries is the maximum number of running queries. // A value of zero will make the maximum query limit unlimited. DefaultMaxConcurrentQueries = 0 DefaultPoolMaxIdleStreams = 100 DefaultPoolMaxConnections = 200 // DefaultMaxSelectPointN is the maximum number of points a SELECT can process. // A value of zero will make the maximum point count unlimited. DefaultMaxSelectPointN = 0 // DefaultMaxSelectSeriesN is the maximum number of series a SELECT can run. // A value of zero will make the maximum series count unlimited. DefaultMaxSelectSeriesN = 0 DefaultMetaService = "127.0.0.1:2347" )
const MaxMessageSize = 1024 * 1024 * 1024 // 1GB
MaxMessageSize defines how large a message can be before we reject it
const MuxHeader = 2
MuxHeader is the header byte used in the TCP mux.
Variables ¶
var ( // ErrTimeout is returned when a write times out. ErrTimeout = errors.New("timeout") // ErrPartialWrite is returned when a write partially succeeds but does // not meet the requested consistency level. ErrPartialWrite = errors.New("partial write") // ErrWriteFailed is returned when no writes succeeded. ErrWriteFailed = errors.New("write failed") )
Functions ¶
func DatabaseShards ¶
func DecodeLV ¶
func DecodeLV(r io.Reader, v encoding.BinaryUnmarshaler) error
DecodeLV reads the length-value record from r and unmarshals it into v.
func EncodeLV ¶
func EncodeLV(w io.Writer, v encoding.BinaryMarshaler) error
EncodeLV encodes v to a binary format and writes the length-value record to w.
func EncodeTLV ¶
EncodeTLV encodes v to a binary format and writes the record-length-value record to w.
func GetShardInfoByIds ¶
func IsRetryable ¶
func NewBoundedPool ¶
func NewBoundedPool(initialCap, maxCap int, timeout time.Duration, factory Factory) (pool.Pool, error)
NewBoundedPool returns a new pool based on buffered channels with an initial capacity, maximum capacity and timeout to wait for a connection from the pool. Factory is used when initial capacity is greater than zero to fill the pool. A zero initialCap doesn't fill the Pool until a new Get() is called. During a Get(), If there is no new connection available in the pool and total connections is less than the max, a new connection will be created via the Factory() method. Othewise, the call will block until a connection is available or the timeout is reached.
func RequestAndParseResponse ¶
Types ¶
type ClusterExecutor ¶
type ClusterExecutor struct { TSDBStore Node *influxdb.Node MetaClient interface { DataNodes() ([]meta.NodeInfo, error) DataNode(nodeId uint64) (*meta.NodeInfo, error) ShardOwner(id uint64) (string, string, *meta.ShardGroupInfo) Database(name string) *meta.DatabaseInfo } // TaskManager holds the StatementExecutor that handles task-related commands. TaskManager query.StatementExecutor RemoteNodeExecutor RemoteNodeExecutor Logger *zap.Logger }
func NewClusterExecutor ¶
func NewClusterExecutor(n *influxdb.Node, s TSDBStore, m MetaClient, Config Config) *ClusterExecutor
func (*ClusterExecutor) CreateIterator ¶
func (me *ClusterExecutor) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.Iterator, error)
func (*ClusterExecutor) DeleteDatabase ¶
func (me *ClusterExecutor) DeleteDatabase(database string) error
func (*ClusterExecutor) DeleteMeasurement ¶
func (me *ClusterExecutor) DeleteMeasurement(database, name string) error
func (*ClusterExecutor) DeleteSeries ¶
func (*ClusterExecutor) ExecuteStatement ¶
func (me *ClusterExecutor) ExecuteStatement(stmt influxql.Statement, ctx *query.ExecutionContext) error
func (*ClusterExecutor) FieldDimensions ¶
func (me *ClusterExecutor) FieldDimensions(m *influxql.Measurement, shards []meta.ShardInfo) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
func (*ClusterExecutor) IteratorCost ¶
func (me *ClusterExecutor) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.IteratorCost, error)
func (*ClusterExecutor) MapType ¶
func (me *ClusterExecutor) MapType(m *influxql.Measurement, field string, shards []meta.ShardInfo) influxql.DataType
func (*ClusterExecutor) MeasurementNames ¶
func (me *ClusterExecutor) MeasurementNames(auth query.Authorizer, database string, cond influxql.Expr) ([][]byte, error)
func (*ClusterExecutor) SeriesCardinality ¶
func (me *ClusterExecutor) SeriesCardinality(database string) (int64, error)
func (*ClusterExecutor) TagKeys ¶
func (me *ClusterExecutor) TagKeys(auth query.Authorizer, ids []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error)
func (*ClusterExecutor) TagValues ¶
func (me *ClusterExecutor) TagValues(auth query.Authorizer, ids []uint64, cond influxql.Expr) ([]tsdb.TagValues, error)
func (*ClusterExecutor) WithLogger ¶
func (me *ClusterExecutor) WithLogger(log *zap.Logger)
type ClusterMetaClient ¶
type ClusterMetaClient struct { NodeID uint64 Logger *zap.Logger // contains filtered or unexported fields }
func NewMetaClient ¶
func NewMetaClient(mc *meta.Config, cc Config, nodeID uint64) *ClusterMetaClient
func (*ClusterMetaClient) AcquireLease ¶
func (me *ClusterMetaClient) AcquireLease(name string) (*meta.Lease, error)
func (*ClusterMetaClient) AddShardOwner ¶
func (me *ClusterMetaClient) AddShardOwner(shardID, nodeID uint64) error
func (*ClusterMetaClient) AdminUserExists ¶
func (me *ClusterMetaClient) AdminUserExists() bool
func (*ClusterMetaClient) Authenticate ¶
func (me *ClusterMetaClient) Authenticate(username, password string) (meta.User, error)
func (*ClusterMetaClient) ClusterID ¶
func (me *ClusterMetaClient) ClusterID() uint64
func (*ClusterMetaClient) CreateContinuousQuery ¶
func (me *ClusterMetaClient) CreateContinuousQuery(database, name, query string) error
func (*ClusterMetaClient) CreateDataNode ¶
func (me *ClusterMetaClient) CreateDataNode(httpAddr, tcpAddr string) (*meta.NodeInfo, error)
func (*ClusterMetaClient) CreateDatabase ¶
func (me *ClusterMetaClient) CreateDatabase(name string) (*meta.DatabaseInfo, error)
func (*ClusterMetaClient) CreateDatabaseWithRetentionPolicy ¶
func (me *ClusterMetaClient) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error)
func (*ClusterMetaClient) CreateRetentionPolicy ¶
func (me *ClusterMetaClient) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error)
func (*ClusterMetaClient) CreateShardGroup ¶
func (me *ClusterMetaClient) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)
func (*ClusterMetaClient) CreateSubscription ¶
func (me *ClusterMetaClient) CreateSubscription(database, rp, name, mode string, destinations []string) error
func (*ClusterMetaClient) CreateUser ¶
func (*ClusterMetaClient) DataNode ¶
func (me *ClusterMetaClient) DataNode(id uint64) (*meta.NodeInfo, error)
func (*ClusterMetaClient) DataNodeByTCPHost ¶
func (me *ClusterMetaClient) DataNodeByTCPHost(addr string) (*meta.NodeInfo, error)
func (*ClusterMetaClient) DataNodes ¶
func (me *ClusterMetaClient) DataNodes() ([]meta.NodeInfo, error)
func (*ClusterMetaClient) Database ¶
func (me *ClusterMetaClient) Database(name string) *meta.DatabaseInfo
func (*ClusterMetaClient) Databases ¶
func (me *ClusterMetaClient) Databases() []meta.DatabaseInfo
func (*ClusterMetaClient) DeleteDataNode ¶
func (me *ClusterMetaClient) DeleteDataNode(id uint64) error
func (*ClusterMetaClient) DeleteShardGroup ¶
func (me *ClusterMetaClient) DeleteShardGroup(database, policy string, id uint64) error
func (*ClusterMetaClient) DropContinuousQuery ¶
func (me *ClusterMetaClient) DropContinuousQuery(database, name string) error
func (*ClusterMetaClient) DropDatabase ¶
func (me *ClusterMetaClient) DropDatabase(name string) error
func (*ClusterMetaClient) DropRetentionPolicy ¶
func (me *ClusterMetaClient) DropRetentionPolicy(database, name string) error
func (*ClusterMetaClient) DropShard ¶
func (me *ClusterMetaClient) DropShard(id uint64) error
func (*ClusterMetaClient) DropSubscription ¶
func (me *ClusterMetaClient) DropSubscription(database, rp, name string) error
func (*ClusterMetaClient) DropUser ¶
func (me *ClusterMetaClient) DropUser(name string) error
func (*ClusterMetaClient) MarshalBinary ¶
func (me *ClusterMetaClient) MarshalBinary() ([]byte, error)
func (*ClusterMetaClient) Open ¶
func (me *ClusterMetaClient) Open() error
func (*ClusterMetaClient) PrecreateShardGroups ¶
func (me *ClusterMetaClient) PrecreateShardGroups(from, to time.Time) error
func (*ClusterMetaClient) PruneShardGroups ¶
func (me *ClusterMetaClient) PruneShardGroups() error
func (*ClusterMetaClient) RemoveShardOwner ¶
func (me *ClusterMetaClient) RemoveShardOwner(shardID, nodeID uint64) error
func (*ClusterMetaClient) RetentionPolicy ¶
func (me *ClusterMetaClient) RetentionPolicy(database, name string) (*meta.RetentionPolicyInfo, error)
func (*ClusterMetaClient) RunSyncLoop ¶
func (me *ClusterMetaClient) RunSyncLoop()
func (*ClusterMetaClient) SetAdminPrivilege ¶
func (me *ClusterMetaClient) SetAdminPrivilege(username string, admin bool) error
func (*ClusterMetaClient) SetPrivilege ¶
func (me *ClusterMetaClient) SetPrivilege(username, database string, p influxql.Privilege) error
func (*ClusterMetaClient) ShardGroupsByTimeRange ¶
func (me *ClusterMetaClient) ShardGroupsByTimeRange(database, policy string, min, max time.Time) ([]meta.ShardGroupInfo, error)
func (*ClusterMetaClient) ShardIDs ¶
func (me *ClusterMetaClient) ShardIDs() []uint64
func (*ClusterMetaClient) ShardOwner ¶
func (me *ClusterMetaClient) ShardOwner(id uint64) (string, string, *meta.ShardGroupInfo)
func (*ClusterMetaClient) TruncateShardGroups ¶
func (me *ClusterMetaClient) TruncateShardGroups(t time.Time) error
func (*ClusterMetaClient) UpdateRetentionPolicy ¶
func (me *ClusterMetaClient) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error
func (*ClusterMetaClient) UpdateUser ¶
func (me *ClusterMetaClient) UpdateUser(name, password string) error
func (*ClusterMetaClient) UserCount ¶
func (me *ClusterMetaClient) UserCount() int
func (*ClusterMetaClient) UserPrivilege ¶
func (me *ClusterMetaClient) UserPrivilege(username, database string) (*influxql.Privilege, error)
func (*ClusterMetaClient) UserPrivileges ¶
func (*ClusterMetaClient) Users ¶
func (me *ClusterMetaClient) Users() []meta.UserInfo
func (*ClusterMetaClient) WaitForDataChanged ¶
func (me *ClusterMetaClient) WaitForDataChanged() chan struct{}
func (*ClusterMetaClient) WithLogger ¶
func (me *ClusterMetaClient) WithLogger(log *zap.Logger)
type ClusterShardMapper ¶
type ClusterShardMapper struct { MetaClient interface { ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error) } Node *influxdb.Node ClusterExecutor interface { IteratorCost(m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.IteratorCost, error) MapType(m *influxql.Measurement, field string, shards []meta.ShardInfo) influxql.DataType CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.Iterator, error) FieldDimensions(m *influxql.Measurement, shards []meta.ShardInfo) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error) } }
ClusterShardMapper implements a ShardMapper for local shards.
func (*ClusterShardMapper) MapShards ¶
func (e *ClusterShardMapper) MapShards(sources influxql.Sources, t influxql.TimeRange, opt query.SelectOptions) (query.ShardGroup, error)
MapShards maps the sources to the appropriate shards into an IteratorCreator.
type ClusterShardMapping ¶
type ClusterShardMapping struct { ClusterExecutor interface { IteratorCost(m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.IteratorCost, error) MapType(m *influxql.Measurement, field string, shards []meta.ShardInfo) influxql.DataType CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions, shards []meta.ShardInfo) (query.Iterator, error) FieldDimensions(m *influxql.Measurement, shards []meta.ShardInfo) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error) } MetaClient interface { ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error) } Node *influxdb.Node // 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 // contains filtered or unexported fields }
ShardMapper maps data sources to a list of shard information.
func (*ClusterShardMapping) Close ¶
func (a *ClusterShardMapping) Close() error
Close clears out the list of mapped shards.
func (*ClusterShardMapping) CreateIterator ¶
func (a *ClusterShardMapping) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error)
func (*ClusterShardMapping) FieldDimensions ¶
func (a *ClusterShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
func (*ClusterShardMapping) IteratorCost ¶
func (a *ClusterShardMapping) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error)
func (*ClusterShardMapping) MapType ¶
func (a *ClusterShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType
type Config ¶
type Config struct { DailTimeout toml.Duration `toml:"dial-timeout"` PoolMaxIdleTimeout toml.Duration `toml:"pool-max-idle-time"` PoolMaxIdleStreams int `toml:"pool-max-idle-streams"` PoolMaxConnections int `toml:"pool-max-connections"` ShardReaderTimeout toml.Duration `toml:"shard-reader-timeout"` ClusterTracing bool `toml:"cluster-tracing"` WriteTimeout toml.Duration `toml:"write-timeout"` MaxConcurrentQueries int `toml:"max-concurrent-queries"` QueryTimeout toml.Duration `toml:"query-timeout"` LogQueriesAfter toml.Duration `toml:"log-queries-after"` MaxSelectPointN int `toml:"max-select-point"` MaxSelectSeriesN int `toml:"max-select-series"` MaxSelectBucketsN int `toml:"max-select-buckets"` MetaServices []string `toml:"meta-services"` PingMetaServiceIntervalMs int64 `toml:"ping-meta-service-interval"` }
Config represents the configuration for the coordinator service.
func (Config) Diagnostics ¶
func (c Config) Diagnostics() (*diagnostics.Diagnostics, error)
Diagnostics returns a diagnostics representation of a subset of the Config.
type CreateIteratorRequest ¶
type CreateIteratorRequest struct { SpanContex *tracing.SpanContext ShardIDs []uint64 Opt query.IteratorOptions Measurement influxql.Measurement }
CreateIteratorRequest represents a request to create a remote iterator.
func (*CreateIteratorRequest) MarshalBinary ¶
func (r *CreateIteratorRequest) MarshalBinary() ([]byte, error)
MarshalBinary encodes r to a binary format.
func (*CreateIteratorRequest) UnmarshalBinary ¶
func (r *CreateIteratorRequest) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes data into r.
type CreateIteratorResponse ¶
CreateIteratorResponse represents a response from remote iterator creation.
func (*CreateIteratorResponse) MarshalBinary ¶
func (r *CreateIteratorResponse) MarshalBinary() ([]byte, error)
MarshalBinary encodes r to a binary format.
func (*CreateIteratorResponse) UnmarshalBinary ¶
func (r *CreateIteratorResponse) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes data into r.
type DeleteDatabaseRequest ¶
type DeleteDatabaseRequest struct {
Database string
}
func (*DeleteDatabaseRequest) MarshalBinary ¶
func (r *DeleteDatabaseRequest) MarshalBinary() ([]byte, error)
func (*DeleteDatabaseRequest) UnmarshalBinary ¶
func (r *DeleteDatabaseRequest) UnmarshalBinary(b []byte) error
type DeleteDatabaseResponse ¶
type DeleteDatabaseResponse struct {
Err string
}
func (*DeleteDatabaseResponse) MarshalBinary ¶
func (r *DeleteDatabaseResponse) MarshalBinary() ([]byte, error)
func (*DeleteDatabaseResponse) UnmarshalBinary ¶
func (r *DeleteDatabaseResponse) UnmarshalBinary(b []byte) error
type DeleteMeasurementRequest ¶
func (*DeleteMeasurementRequest) MarshalBinary ¶
func (r *DeleteMeasurementRequest) MarshalBinary() ([]byte, error)
func (*DeleteMeasurementRequest) UnmarshalBinary ¶
func (r *DeleteMeasurementRequest) UnmarshalBinary(b []byte) error
type DeleteMeasurementResponse ¶
type DeleteMeasurementResponse struct {
Err string
}
func (*DeleteMeasurementResponse) MarshalBinary ¶
func (r *DeleteMeasurementResponse) MarshalBinary() ([]byte, error)
func (*DeleteMeasurementResponse) UnmarshalBinary ¶
func (r *DeleteMeasurementResponse) UnmarshalBinary(b []byte) error
type DeleteSeriesRequest ¶
func (*DeleteSeriesRequest) MarshalBinary ¶
func (r *DeleteSeriesRequest) MarshalBinary() ([]byte, error)
func (*DeleteSeriesRequest) UnmarshalBinary ¶
func (r *DeleteSeriesRequest) UnmarshalBinary(b []byte) error
type DeleteSeriesResponse ¶
type DeleteSeriesResponse struct {
Err string
}
func (*DeleteSeriesResponse) MarshalBinary ¶
func (r *DeleteSeriesResponse) MarshalBinary() ([]byte, error)
func (*DeleteSeriesResponse) UnmarshalBinary ¶
func (r *DeleteSeriesResponse) UnmarshalBinary(b []byte) error
type ExecuteStatementRequest ¶
type ExecuteStatementRequest struct {
// contains filtered or unexported fields
}
ExecuteStatementRequest represents the a request to execute a statement on a node.
func (*ExecuteStatementRequest) Database ¶
func (r *ExecuteStatementRequest) Database() string
Database returns the database name.
func (*ExecuteStatementRequest) MarshalBinary ¶
func (r *ExecuteStatementRequest) MarshalBinary() ([]byte, error)
MarshalBinary encodes the object to a binary format.
func (*ExecuteStatementRequest) SetDatabase ¶
func (r *ExecuteStatementRequest) SetDatabase(database string)
SetDatabase sets the database name.
func (*ExecuteStatementRequest) SetStatement ¶
func (r *ExecuteStatementRequest) SetStatement(statement string)
SetStatement sets the InfluxQL statement.
func (*ExecuteStatementRequest) Statement ¶
func (r *ExecuteStatementRequest) Statement() string
Statement returns the InfluxQL statement.
func (*ExecuteStatementRequest) UnmarshalBinary ¶
func (r *ExecuteStatementRequest) UnmarshalBinary(buf []byte) error
UnmarshalBinary populates ExecuteStatementRequest from a binary format.
type ExecuteStatementResponse ¶
type ExecuteStatementResponse struct {
// contains filtered or unexported fields
}
ExecuteStatementResponse represents the response returned from a remote ExecuteStatementRequest call.
func (*ExecuteStatementResponse) Code ¶
func (w *ExecuteStatementResponse) Code() int
Code returns the response code.
func (*ExecuteStatementResponse) MarshalBinary ¶
func (w *ExecuteStatementResponse) MarshalBinary() ([]byte, error)
MarshalBinary encodes the object to a binary format.
func (*ExecuteStatementResponse) Message ¶
func (w *ExecuteStatementResponse) Message() string
Message returns the repsonse message.
func (*ExecuteStatementResponse) SetCode ¶
func (w *ExecuteStatementResponse) SetCode(code int)
SetCode sets the Code
func (*ExecuteStatementResponse) SetMessage ¶
func (w *ExecuteStatementResponse) SetMessage(message string)
SetMessage sets the Message
func (*ExecuteStatementResponse) UnmarshalBinary ¶
func (w *ExecuteStatementResponse) UnmarshalBinary(buf []byte) error
UnmarshalBinary populates ExecuteStatementResponse from a binary format.
type FieldDimensionsRequest ¶
FieldDimensionsRequest represents a request to retrieve unique fields & dimensions.
func (*FieldDimensionsRequest) MarshalBinary ¶
func (r *FieldDimensionsRequest) MarshalBinary() ([]byte, error)
MarshalBinary encodes r to a binary format.
func (*FieldDimensionsRequest) UnmarshalBinary ¶
func (r *FieldDimensionsRequest) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes data into r.
type FieldDimensionsResponse ¶
type FieldDimensionsResponse struct { Fields map[string]influxql.DataType Dimensions map[string]struct{} Err error }
FieldDimensionsResponse represents a response from remote iterator creation.
func (*FieldDimensionsResponse) MarshalBinary ¶
func (r *FieldDimensionsResponse) MarshalBinary() ([]byte, error)
MarshalBinary encodes r to a binary format.
func (*FieldDimensionsResponse) UnmarshalBinary ¶
func (r *FieldDimensionsResponse) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes data into r.
type InternalServiceStatistics ¶
type InternalServiceStatistics struct { WriteShardReq int64 WriteShardPointsReq int64 WriteShardFail int64 CreateIteratorReq int64 CreateIteratorFail int64 FieldDimensionsReq int64 FieldDimensionsFail int64 TagKeysReq int64 TagKeysFail int64 TagValuesReq int64 TagValuesFail int64 MeasurementNamesReq int64 MeasurementNamesFail int64 SeriesCardinalityReq int64 SeriesCardinalityFail int64 IteratorCostReq int64 IteratorCostFail int64 MapTypeReq int64 MapTypeFail int64 }
type IteratorCostRequest ¶
type IteratorCostRequest struct { Sources influxql.Sources Opt query.IteratorOptions ShardIDs []uint64 }
func (*IteratorCostRequest) MarshalBinary ¶
func (r *IteratorCostRequest) MarshalBinary() ([]byte, error)
func (*IteratorCostRequest) UnmarshalBinary ¶
func (r *IteratorCostRequest) UnmarshalBinary(b []byte) error
type IteratorCostResponse ¶
type IteratorCostResponse struct { Cost query.IteratorCost Err string }
func (*IteratorCostResponse) MarshalBinary ¶
func (r *IteratorCostResponse) MarshalBinary() ([]byte, error)
func (*IteratorCostResponse) UnmarshalBinary ¶
func (r *IteratorCostResponse) UnmarshalBinary(b []byte) error
type LocalTSDBStore ¶
LocalTSDBStore embeds a tsdb.Store and implements IteratorCreator to satisfy the TSDBStore interface.
type MapTypeRequest ¶
func (*MapTypeRequest) MarshalBinary ¶
func (r *MapTypeRequest) MarshalBinary() ([]byte, error)
func (*MapTypeRequest) UnmarshalBinary ¶
func (r *MapTypeRequest) UnmarshalBinary(b []byte) error
type MapTypeRequestProto ¶
type MapTypeResponse ¶
func (*MapTypeResponse) MarshalBinary ¶
func (r *MapTypeResponse) MarshalBinary() ([]byte, error)
func (*MapTypeResponse) UnmarshalBinary ¶
func (r *MapTypeResponse) UnmarshalBinary(b []byte) error
type Measurement ¶
type MeasurementNamesProto ¶
type MeasurementNamesRequest ¶
func (*MeasurementNamesRequest) MarshalBinary ¶
func (r *MeasurementNamesRequest) MarshalBinary() ([]byte, error)
func (*MeasurementNamesRequest) UnmarshalBinary ¶
func (r *MeasurementNamesRequest) UnmarshalBinary(b []byte) error
type MeasurementNamesResponse ¶
func (*MeasurementNamesResponse) MarshalBinary ¶
func (r *MeasurementNamesResponse) MarshalBinary() ([]byte, error)
func (*MeasurementNamesResponse) UnmarshalBinary ¶
func (r *MeasurementNamesResponse) UnmarshalBinary(b []byte) error
type MetaClient ¶
type MetaClient interface { CreateContinuousQuery(database, name, query string) error CreateDatabase(name string) (*meta.DatabaseInfo, error) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error) CreateSubscription(database, rp, name, mode string, destinations []string) error CreateUser(name, password string, admin bool) (meta.User, error) Database(name string) *meta.DatabaseInfo Databases() []meta.DatabaseInfo DataNodes() ([]meta.NodeInfo, error) DataNode(nodeId uint64) (*meta.NodeInfo, error) DropShard(id uint64) error DropContinuousQuery(database, name string) error DropDatabase(name string) error DropRetentionPolicy(database, name string) error DropSubscription(database, rp, name string) error DropUser(name string) error RetentionPolicy(database, name string) (rpi *meta.RetentionPolicyInfo, err error) SetAdminPrivilege(username string, admin bool) error SetPrivilege(username, database string, p influxql.Privilege) error ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error) ShardOwner(id uint64) (string, string, *meta.ShardGroupInfo) TruncateShardGroups(t time.Time) error UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error UpdateUser(name, password string) error UserPrivilege(username, database string) (*influxql.Privilege, error) UserPrivileges(username string) (map[string]influxql.Privilege, error) Users() []meta.UserInfo }
MetaClient is an interface for accessing meta data.
type MetaClientImpl ¶
type MetaClientImpl struct {
Addrs []string
}
func (*MetaClientImpl) AcquireLease ¶
func (*MetaClientImpl) AddShardOwner ¶
func (me *MetaClientImpl) AddShardOwner(shardID, nodeID uint64) error
func (*MetaClientImpl) Authenticate ¶
func (me *MetaClientImpl) Authenticate(username, password string) (meta.User, error)
func (*MetaClientImpl) ClusterID ¶
func (me *MetaClientImpl) ClusterID() uint64
func (*MetaClientImpl) CreateContinuousQuery ¶
func (me *MetaClientImpl) CreateContinuousQuery(database, name, query string) error
func (*MetaClientImpl) CreateDataNode ¶
func (me *MetaClientImpl) CreateDataNode(httpAddr, tcpAddr string) (*meta.NodeInfo, error)
func (*MetaClientImpl) CreateDatabase ¶
func (me *MetaClientImpl) CreateDatabase(name string) (*meta.DatabaseInfo, error)
func (*MetaClientImpl) CreateDatabaseWithRetentionPolicy ¶
func (me *MetaClientImpl) CreateDatabaseWithRetentionPolicy(name string, spec *meta.RetentionPolicySpec) (*meta.DatabaseInfo, error)
func (*MetaClientImpl) CreateRetentionPolicy ¶
func (me *MetaClientImpl) CreateRetentionPolicy(database string, spec *meta.RetentionPolicySpec, makeDefault bool) (*meta.RetentionPolicyInfo, error)
func (*MetaClientImpl) CreateShardGroup ¶
func (me *MetaClientImpl) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)
func (*MetaClientImpl) CreateSubscription ¶
func (me *MetaClientImpl) CreateSubscription(database, rp, name, mode string, destinations []string) error
func (*MetaClientImpl) CreateUser ¶
func (*MetaClientImpl) DeleteDataNode ¶
func (me *MetaClientImpl) DeleteDataNode(id uint64) error
func (*MetaClientImpl) DeleteShardGroup ¶
func (me *MetaClientImpl) DeleteShardGroup(database, policy string, id uint64) error
func (*MetaClientImpl) DropContinuousQuery ¶
func (me *MetaClientImpl) DropContinuousQuery(database, name string) error
func (*MetaClientImpl) DropDatabase ¶
func (me *MetaClientImpl) DropDatabase(name string) error
func (*MetaClientImpl) DropRetentionPolicy ¶
func (me *MetaClientImpl) DropRetentionPolicy(database, name string) error
func (*MetaClientImpl) DropShard ¶
func (me *MetaClientImpl) DropShard(id uint64) error
func (*MetaClientImpl) DropSubscription ¶
func (me *MetaClientImpl) DropSubscription(database, rp, name string) error
func (*MetaClientImpl) DropUser ¶
func (me *MetaClientImpl) DropUser(name string) error
func (*MetaClientImpl) Ping ¶
func (me *MetaClientImpl) Ping() (uint64, error)
func (*MetaClientImpl) PrecreateShardGroups ¶
func (me *MetaClientImpl) PrecreateShardGroups(from, to time.Time) error
func (*MetaClientImpl) PruneShardGroups ¶
func (me *MetaClientImpl) PruneShardGroups() error
func (*MetaClientImpl) RemoveShardOwner ¶
func (me *MetaClientImpl) RemoveShardOwner(shardID, nodeID uint64) error
func (*MetaClientImpl) SetAdminPrivilege ¶
func (me *MetaClientImpl) SetAdminPrivilege(username string, admin bool) error
func (*MetaClientImpl) SetPrivilege ¶
func (me *MetaClientImpl) SetPrivilege(username, database string, p influxql.Privilege) error
func (*MetaClientImpl) TruncateShardGroups ¶
func (me *MetaClientImpl) TruncateShardGroups(t time.Time) error
func (*MetaClientImpl) UpdateRetentionPolicy ¶
func (me *MetaClientImpl) UpdateRetentionPolicy(database, name string, rpu *meta.RetentionPolicyUpdate, makeDefault bool) error
func (*MetaClientImpl) UpdateUser ¶
func (me *MetaClientImpl) UpdateUser(name, password string) error
func (*MetaClientImpl) Url ¶
func (me *MetaClientImpl) Url(path string) string
type Node2ShardIDs ¶
func NewNode2ShardIDs ¶
func (Node2ShardIDs) Apply ¶
func (me Node2ShardIDs) Apply(fn func(nodeId uint64, shardIDs []uint64))
type NodeDialer ¶
type NodeDialer struct { MetaClient interface { DataNode(nodeId uint64) (*meta.NodeInfo, error) } Timeout time.Duration }
NodeDialer dials connections to a given node.
type PointsWriter ¶
type PointsWriter struct { WriteTimeout time.Duration Logger *zap.Logger Node *influxdb.Node HintedHandoff interface { WriteShard(shardID, ownerID uint64, points []models.Point) error } MetaClient interface { Database(name string) (di *meta.DatabaseInfo) RetentionPolicy(database, policy string) (*meta.RetentionPolicyInfo, error) CreateShardGroup(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error) } TSDBStore interface { CreateShard(database, retentionPolicy string, shardID uint64, enabled bool) error WriteToShard(shardID uint64, points []models.Point) error } ShardWriter interface { WriteShard(shardID, ownerID uint64, points []models.Point) error } // contains filtered or unexported fields }
PointsWriter handles writes across multiple local and remote data nodes.
func NewPointsWriter ¶
func NewPointsWriter() *PointsWriter
NewPointsWriter returns a new instance of PointsWriter for a node.
func (*PointsWriter) AddWriteSubscriber ¶
func (w *PointsWriter) AddWriteSubscriber(c chan<- *WritePointsRequest)
func (*PointsWriter) Close ¶
func (w *PointsWriter) Close() error
Close closes the communication channel with the point writer.
func (*PointsWriter) MapShards ¶
func (w *PointsWriter) MapShards(wp *WritePointsRequest) (*ShardMapping, error)
MapShards maps the points contained in wp to a ShardMapping. If a point maps to a shard group or shard that does not currently exist, it will be created before returning the mapping.
func (*PointsWriter) Open ¶
func (w *PointsWriter) Open() error
Open opens the communication channel with the point writer.
func (*PointsWriter) Statistics ¶
func (w *PointsWriter) Statistics(tags map[string]string) []models.Statistic
Statistics returns statistics for periodic monitoring.
func (*PointsWriter) WithLogger ¶
func (w *PointsWriter) WithLogger(log *zap.Logger)
WithLogger sets the Logger on w.
func (*PointsWriter) WritePoints ¶
func (w *PointsWriter) WritePoints(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, user meta.User, points []models.Point) error
WritePoints writes the data to the underlying storage. consitencyLevel and user are only used for clustered scenarios
func (*PointsWriter) WritePointsInto ¶
func (w *PointsWriter) WritePointsInto(p *influxdb_coordinator.IntoWriteRequest) error
WritePointsInto is a copy of WritePoints that uses a tsdb structure instead of a cluster structure for information. This is to avoid a circular dependency.
func (*PointsWriter) WritePointsPrivileged ¶
func (w *PointsWriter) WritePointsPrivileged(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, points []models.Point) error
WritePointsPrivileged writes the data to the underlying storage, consitencyLevel is only used for clustered scenarios
type RemoteNodeExecutor ¶
type RemoteNodeExecutor interface { TagKeys(nodeId uint64, ShardIDs []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error) TagValues(nodeId uint64, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagValues, error) MeasurementNames(nodeId uint64, database string, cond influxql.Expr) ([][]byte, error) SeriesCardinality(nodeId uint64, database string) (int64, error) DeleteSeries(nodeId uint64, database string, sources []influxql.Source, condition influxql.Expr) error DeleteDatabase(nodeId uint64, database string) error DeleteMeasurement(nodeId uint64, database, name string) error FieldDimensions(nodeId uint64, m *influxql.Measurement, shardIds []uint64) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error) IteratorCost(nodeId uint64, m *influxql.Measurement, opt query.IteratorOptions, shardIds []uint64) (query.IteratorCost, error) MapType(nodeId uint64, m *influxql.Measurement, field string, shardIds []uint64) (influxql.DataType, error) CreateIterator(nodeId uint64, ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions, shardIds []uint64) (query.Iterator, error) TaskManagerStatement(nodeId uint64, stmt influxql.Statement) (*query.Result, error) }
type SeriesCardinalityRequest ¶
type SeriesCardinalityRequest struct {
Database string
}
func (*SeriesCardinalityRequest) MarshalBinary ¶
func (r *SeriesCardinalityRequest) MarshalBinary() ([]byte, error)
func (*SeriesCardinalityRequest) UnmarshalBinary ¶
func (r *SeriesCardinalityRequest) UnmarshalBinary(b []byte) error
type SeriesCardinalityResponse ¶
func (*SeriesCardinalityResponse) MarshalBinary ¶
func (r *SeriesCardinalityResponse) MarshalBinary() ([]byte, error)
func (*SeriesCardinalityResponse) UnmarshalBinary ¶
func (r *SeriesCardinalityResponse) UnmarshalBinary(b []byte) error
type Service ¶
type Service struct { Node *influxdb.Node Listener net.Listener MetaClient interface { ShardOwner(shardID uint64) (string, string, *meta.ShardGroupInfo) } TSDBStore TSDBStore TaskManager *query.TaskManager Logger *zap.Logger // contains filtered or unexported fields }
Service processes data received over raw TCP connections.
func (*Service) Statistics ¶
func (*Service) WithLogger ¶
WithLogger sets the logger on the service.
type ShardMapping ¶
type ShardMapping struct { Points map[uint64][]models.Point // The points associated with a shard ID Shards map[uint64]*meta.ShardInfo // The shards that have been mapped, keyed by shard ID Dropped []models.Point // Points that were dropped // contains filtered or unexported fields }
ShardMapping contains a mapping of shards to points.
func NewShardMapping ¶
func NewShardMapping(n int) *ShardMapping
NewShardMapping creates an empty ShardMapping.
type ShardWriter ¶
type ShardWriter struct { MetaClient interface { DataNode(id uint64) (ni *meta.NodeInfo, err error) ShardOwner(shardID uint64) (database, policy string, sgi *meta.ShardGroupInfo) } // contains filtered or unexported fields }
ShardWriter writes a set of points to a shard.
func NewShardWriter ¶
func NewShardWriter(timeout time.Duration, maxConnections int) *ShardWriter
NewShardWriter returns a new instance of ShardWriter.
func (*ShardWriter) WriteShard ¶
func (w *ShardWriter) WriteShard(shardID, ownerID uint64, points []models.Point) error
WriteShard writes time series points to a shard
type StringSlice ¶
type StringSlice []string
func (StringSlice) Len ¶
func (a StringSlice) Len() int
func (StringSlice) Less ¶
func (a StringSlice) Less(i, j int) bool
func (StringSlice) Swap ¶
func (a StringSlice) Swap(i, j int)
type TSDBStore ¶
type TSDBStore interface { CreateShard(database, policy string, shardID uint64, enabled bool) error WriteToShard(shardID uint64, points []models.Point) error RestoreShard(id uint64, r io.Reader) error BackupShard(id uint64, since time.Time, w io.Writer) error DeleteDatabase(name string) error DeleteMeasurement(database, name string) error DeleteRetentionPolicy(database, name string) error DeleteSeries(database string, sources []influxql.Source, condition influxql.Expr) error DeleteShard(id uint64) error MeasurementNames(auth query.Authorizer, database string, cond influxql.Expr) ([][]byte, error) TagKeys(auth query.Authorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagKeys, error) TagValues(auth query.Authorizer, shardIDs []uint64, cond influxql.Expr) ([]tsdb.TagValues, error) SeriesCardinality(database string) (int64, error) MeasurementsCardinality(database string) (int64, error) ShardGroup(ids []uint64) tsdb.ShardGroup }
TSDBStore is an interface for accessing the time series data store.
type TagKeysProto ¶
type TagKeysRequest ¶
func (*TagKeysRequest) MarshalBinary ¶
func (r *TagKeysRequest) MarshalBinary() ([]byte, error)
func (*TagKeysRequest) UnmarshalBinary ¶
func (r *TagKeysRequest) UnmarshalBinary(b []byte) error
type TagKeysResponse ¶
func (*TagKeysResponse) MarshalBinary ¶
func (r *TagKeysResponse) MarshalBinary() ([]byte, error)
func (*TagKeysResponse) UnmarshalBinary ¶
func (r *TagKeysResponse) UnmarshalBinary(b []byte) error
type TagValuesRequest ¶
type TagValuesRequest struct {
TagKeysRequest
}
type TagValuesResponse ¶
func (*TagValuesResponse) MarshalBinary ¶
func (r *TagValuesResponse) MarshalBinary() ([]byte, error)
func (*TagValuesResponse) UnmarshalBinary ¶
func (r *TagValuesResponse) UnmarshalBinary(b []byte) error
type TaskManagerStatementRequest ¶
type TaskManagerStatementRequest struct {
ExecuteStatementRequest
}
type TaskManagerStatementResponse ¶
func (*TaskManagerStatementResponse) MarshalBinary ¶
func (w *TaskManagerStatementResponse) MarshalBinary() ([]byte, error)
func (*TaskManagerStatementResponse) UnmarshalBinary ¶
func (w *TaskManagerStatementResponse) UnmarshalBinary(buf []byte) error
type WritePointsRequest ¶
type WritePointsRequest struct { Database string RetentionPolicy string //ConsistencyLevel models.ConsistencyLevel Points []models.Point }
WritePointsRequest represents a request to write point data to the cluster
type WriteShardRequest ¶
type WriteShardRequest struct {
// contains filtered or unexported fields
}
WriteShardRequest represents the a request to write a slice of points to a shard
func (*WriteShardRequest) AddPoint ¶
func (w *WriteShardRequest) AddPoint(name string, value interface{}, timestamp time.Time, tags models.Tags)
AddPoint adds a new time series point
func (*WriteShardRequest) AddPoints ¶
func (w *WriteShardRequest) AddPoints(points []models.Point)
AddPoints adds a new time series point
func (*WriteShardRequest) Database ¶
func (w *WriteShardRequest) Database() string
func (*WriteShardRequest) MarshalBinary ¶
func (w *WriteShardRequest) MarshalBinary() ([]byte, error)
MarshalBinary encodes the object to a binary format.
func (*WriteShardRequest) Points ¶
func (w *WriteShardRequest) Points() []models.Point
Points returns the time series Points
func (*WriteShardRequest) RetentionPolicy ¶
func (w *WriteShardRequest) RetentionPolicy() string
func (*WriteShardRequest) SetDatabase ¶
func (w *WriteShardRequest) SetDatabase(db string)
func (*WriteShardRequest) SetRetentionPolicy ¶
func (w *WriteShardRequest) SetRetentionPolicy(rp string)
func (*WriteShardRequest) SetShardID ¶
func (w *WriteShardRequest) SetShardID(id uint64)
SetShardID sets the ShardID
func (*WriteShardRequest) ShardID ¶
func (w *WriteShardRequest) ShardID() uint64
ShardID gets the ShardID
func (*WriteShardRequest) UnmarshalBinary ¶
func (w *WriteShardRequest) UnmarshalBinary(buf []byte) error
UnmarshalBinary populates WritePointRequest from a binary format.
type WriteShardResponse ¶
type WriteShardResponse struct {
// contains filtered or unexported fields
}
WriteShardResponse represents the response returned from a remote WriteShardRequest call
func (*WriteShardResponse) MarshalBinary ¶
func (w *WriteShardResponse) MarshalBinary() ([]byte, error)
MarshalBinary encodes the object to a binary format.
func (*WriteShardResponse) Message ¶
func (w *WriteShardResponse) Message() string
Message returns the Message
func (*WriteShardResponse) SetCode ¶
func (w *WriteShardResponse) SetCode(code int)
SetCode sets the Code
func (*WriteShardResponse) SetMessage ¶
func (w *WriteShardResponse) SetMessage(message string)
SetMessage sets the Message
func (*WriteShardResponse) UnmarshalBinary ¶
func (w *WriteShardResponse) UnmarshalBinary(buf []byte) error
UnmarshalBinary populates WritePointRequest from a binary format.
type WriteStatistics ¶
type WriteStatistics struct { WriteReq int64 PointWriteReq int64 PointWriteReqLocal int64 PointWriteReqRemote int64 WriteOK int64 WriteDropped int64 WriteTimeout int64 WritePartial int64 WritePointReqHH int64 WriteErr int64 SubWriteOK int64 SubWriteDrop int64 }
WriteStatistics keeps statistics related to the PointsWriter.