Documentation
¶
Index ¶
- Constants
- Variables
- 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 MarchalBinayMeasurement(mm influxql.Measurement) ([]byte, error)
- 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 UnMarchalBinayMeasurement(pb *internal.Measurement) (*influxql.Measurement, 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 Config
- type CreateIteratorRequest
- type CreateIteratorResponse
- type DistributedShardMapper
- 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 IteratorCostRequest
- type IteratorCostResponse
- type IteratorCreator
- type MapTypeRequest
- type MapTypeResponse
- type MetaExecutor
- type NodeDialer
- type PointsWriter
- 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 *coordinator.IntoWriteRequest) error
- func (w *PointsWriter) WritePointsPrivileged(database, retentionPolicy string, consistencyLevel models.ConsistencyLevel, ...) error
- type RemoteShardMapping
- func (rsm *RemoteShardMapping) Close() error
- func (rsm *RemoteShardMapping) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error)
- func (rsm *RemoteShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
- func (rsm *RemoteShardMapping) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error)
- func (rsm *RemoteShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType
- func (rsm *RemoteShardMapping) WithLogger(logger zap.Logger)
- type RpcError
- type Service
- type ServiceStatistics
- type ShardMapper
- type ShardMapping
- type ShardMappings
- func (sm *ShardMappings) Close() error
- func (sm *ShardMappings) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error)
- func (sm *ShardMappings) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
- func (sm *ShardMappings) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error)
- func (sm *ShardMappings) MapType(m *influxql.Measurement, field string) influxql.DataType
- func (sm *ShardMappings) WithLogger(logger zap.Logger)
- type ShardWriter
- type StatementExecutor
- 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 ( // DefaultShardWriterTimeout is the default timeout set on shard writers. DefaultShardWriterTimeout = 5 * time.Second // DefaultShardMapperTimeout is the default timeout set on shard mappers. DefaultShardMapperTimeout = 5 * time.Second // DefaultMaxRemoteWriteConnections is the maximum number of open connections // that will be available for remote writes to another host. DefaultMaxRemoteWriteConnections = 3 DefaultWriteTimeout = 10 * time.Second // DefaultMaxConcurrentQueries is the maximum number of running queries. // A value of zero will make the maximum query limit unlimited. DefaultMaxConcurrentQueries = 0 // 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 )
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 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 MarchalBinayMeasurement ¶
func MarchalBinayMeasurement(mm influxql.Measurement) ([]byte, error)
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 UnMarchalBinayMeasurement ¶
func UnMarchalBinayMeasurement(pb *internal.Measurement) (*influxql.Measurement, error)
Types ¶
type Config ¶
type Config struct {
ForceRemoteShardMapping bool `toml:"force-remote-mapping"`
WriteTimeout toml.Duration `toml:"write-timeout"`
ShardWriterTimeout toml.Duration `toml:"shard-writer-timeout"`
MaxRemoteWriteConnections int `toml:"max-remote-write-connections"`
ShardMapperTimeout toml.Duration `toml:"shard-mapper-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"`
BindAddress string `toml:"bind-address"`
}
Config represents the configuration for the clustering 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 {
Measurement *influxql.Measurement
Opt query.IteratorOptions
ShardIDs []uint64
}
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 ¶
type CreateIteratorResponse struct {
Err error
}
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 DistributedShardMapper ¶
type DistributedShardMapper struct {
MetaClient interface {
ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error)
DataNode(id uint64) (*meta.NodeInfo, error)
ShardIsReadable(shardID, nodeID uint64) bool
}
TSDBStore interface {
ShardGroup(ids []uint64) tsdb.ShardGroup
}
Node *meta.NodeInfo
// Remote execution timeout
Timeout time.Duration
Logger zap.Logger
}
func (*DistributedShardMapper) MapShards ¶
func (c *DistributedShardMapper) MapShards(sources influxql.Sources, t influxql.TimeRange, opt query.SelectOptions) (query.ShardGroup, 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 IteratorCostRequest ¶
type IteratorCostRequest struct {
ShardIDs []uint64
Measurement *influxql.Measurement
IteratorOptions *query.IteratorOptions
}
func (*IteratorCostRequest) MarshalBinary ¶
func (m *IteratorCostRequest) MarshalBinary() ([]byte, error)
func (*IteratorCostRequest) UnmarshalBinary ¶
func (m *IteratorCostRequest) UnmarshalBinary(data []byte) error
type IteratorCostResponse ¶
type IteratorCostResponse struct {
Error string
IteratorCost query.IteratorCost
}
func (*IteratorCostResponse) MarshalBinary ¶
func (m *IteratorCostResponse) MarshalBinary() ([]byte, error)
func (*IteratorCostResponse) UnmarshalBinary ¶
func (m *IteratorCostResponse) UnmarshalBinary(data []byte) error
type IteratorCreator ¶
type IteratorCreator interface {
query.IteratorCreator
influxql.FieldMapper
io.Closer
}
IteratorCreator is an interface that combines mapping fields and creating iterators.
type MapTypeRequest ¶
func (*MapTypeRequest) MarshalBinary ¶
func (m *MapTypeRequest) MarshalBinary() ([]byte, error)
func (*MapTypeRequest) UnmarshalBinary ¶
func (m *MapTypeRequest) UnmarshalBinary(data []byte) error
type MapTypeResponse ¶
func (*MapTypeResponse) MarshalBinary ¶
func (m *MapTypeResponse) MarshalBinary() ([]byte, error)
func (*MapTypeResponse) UnmarshalBinary ¶
func (m *MapTypeResponse) UnmarshalBinary(data []byte) error
type MetaExecutor ¶
type MetaExecutor struct {
Logger zap.Logger
Node *meta.NodeInfo
MetaClient interface {
DataNode(id uint64) (ni *meta.NodeInfo, err error)
DataNodes() ([]meta.NodeInfo, error)
}
// 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) ExecuteStatement ¶
func (m *MetaExecutor) ExecuteStatement(stmt influxql.Statement, database string) error
ExecuteStatement executes a single InfluxQL statement on all nodes in the cluster concurrently.
func (*MetaExecutor) WithLogger ¶
func (w *MetaExecutor) WithLogger(log zap.Logger)
type NodeDialer ¶
type NodeDialer struct {
MetaClient interface {
DataNode(id 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 *meta.NodeInfo
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
}
HintedHandoff interface {
WriteShard(shardID, ownerID uint64, points []models.Point) error
}
Subscriber interface {
Points() chan<- *WritePointsRequest
}
// 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) 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 *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 RemoteShardMapping ¶
ShardMapper maps data sources to a list of shard information.
func NewRemoteShardMapping ¶
func NewRemoteShardMapping(dialer *NodeDialer, nodeID uint64, shardMap map[coordinator.Source][]uint64) *RemoteShardMapping
func (*RemoteShardMapping) Close ¶
func (rsm *RemoteShardMapping) Close() error
func (*RemoteShardMapping) CreateIterator ¶
func (rsm *RemoteShardMapping) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error)
CreateIterator creates a remote streaming iterator.
func (*RemoteShardMapping) FieldDimensions ¶
func (rsm *RemoteShardMapping) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
FieldDimensions returns the unique fields and dimensions across a list of sources.
func (*RemoteShardMapping) IteratorCost ¶
func (rsm *RemoteShardMapping) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error)
func (*RemoteShardMapping) MapType ¶
func (rsm *RemoteShardMapping) MapType(m *influxql.Measurement, field string) influxql.DataType
func (*RemoteShardMapping) WithLogger ¶
func (rsm *RemoteShardMapping) WithLogger(logger zap.Logger)
type Service ¶
type Service struct {
Listener net.Listener
MetaClient interface {
ShardOwner(shardID uint64) (string, string, *meta.ShardGroupInfo)
}
TSDBStore interface {
ShardGroup(ids []uint64) tsdb.ShardGroup
WriteToShard(shardID uint64, points []models.Point) error
DeleteDatabase(name string) error
DeleteRetentionPolicy(database, name string) error
DeleteMeasurement(database, name string) error
DeleteSeries(database string, sources []influxql.Source, condition influxql.Expr) error
CreateShard(database, retentionPolicy string, shardID uint64, enabled bool) error
}
Config *Config
Logger zap.Logger
// contains filtered or unexported fields
}
Service processes data received over raw TCP connections.
func (*Service) WithLogger ¶
SetLogger sets the internal logger to the logger passed in.
type ServiceStatistics ¶
type ShardMapper ¶
type ShardMapper interface {
MapShards(sources influxql.Sources, opt *query.SelectOptions) (IteratorCreator, error)
}
ShardMapper retrieves and maps shards into an IteratorCreator that can later be used for executing queries.
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 ShardMappings ¶
type ShardMappings struct {
Local *coordinator.LocalShardMapping
Remotes []*RemoteShardMapping
HasLocal bool
Logger zap.Logger
}
func (*ShardMappings) Close ¶
func (sm *ShardMappings) Close() error
func (*ShardMappings) CreateIterator ¶
func (sm *ShardMappings) CreateIterator(ctx context.Context, m *influxql.Measurement, opt query.IteratorOptions) (query.Iterator, error)
func (*ShardMappings) FieldDimensions ¶
func (sm *ShardMappings) FieldDimensions(m *influxql.Measurement) (fields map[string]influxql.DataType, dimensions map[string]struct{}, err error)
func (*ShardMappings) IteratorCost ¶
func (sm *ShardMappings) IteratorCost(m *influxql.Measurement, opt query.IteratorOptions) (query.IteratorCost, error)
Determines the potential cost for creating an iterator.
func (*ShardMappings) MapType ¶
func (sm *ShardMappings) MapType(m *influxql.Measurement, field string) influxql.DataType
func (*ShardMappings) WithLogger ¶
func (sm *ShardMappings) WithLogger(logger zap.Logger)
type ShardWriter ¶
type ShardWriter struct {
MetaClient interface {
DataNode(id uint64) (ni *meta.NodeInfo, err error)
ShardOwner(shardID uint64) (database, policy string, sgi *meta.ShardGroupInfo)
}
Logger zap.Logger
// 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) WithLogger ¶
func (w *ShardWriter) WithLogger(log zap.Logger)
WithLogger sets the Logger on w.
func (*ShardWriter) WriteShard ¶
func (w *ShardWriter) WriteShard(shardID, ownerID uint64, points []models.Point) error
WriteShard writes time series points to a shard
type StatementExecutor ¶
type StatementExecutor struct {
coordinator.StatementExecutor
MetaExecutor *MetaExecutor
}
func (*StatementExecutor) ExecuteStatement ¶
func (e *StatementExecutor) ExecuteStatement(stmt influxql.Statement, ctx query.ExecutionContext) error
ExecuteStatement executes the given statement with the given execution context.
type WritePointsRequest ¶
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
WriteErr int64
SubWriteOK int64
SubWriteDrop int64
WritePointReqHH int64
WritePartial int64
}
WriteStatistics keeps statistics related to the PointsWriter.