Documentation
¶
Index ¶
- Constants
- Variables
- func ReadTLV(r io.Reader) (byte, []byte, error)
- func WriteTLV(w io.Writer, typ byte, buf []byte) error
- type Config
- type ConsistencyLevel
- type PointsWriter
- type Service
- type ShardMapping
- type ShardWriter
- type WritePointsRequest
- type WriteShardRequest
- func (w *WriteShardRequest) AddPoint(name string, value interface{}, timestamp time.Time, tags map[string]string)
- func (w *WriteShardRequest) AddPoints(points []tsdb.Point)
- func (w *WriteShardRequest) MarshalBinary() ([]byte, error)
- func (w *WriteShardRequest) Points() []tsdb.Point
- 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
Constants ¶
View Source
const ( // DefaultShardWriterTimeout is the default timeout set on shard writers. DefaultShardWriterTimeout = 5 * time.Second )
View Source
const DefaultWriteTimeout = 5 * time.Second
View Source
const MaxMessageSize = 1024 * 1024 * 1024 // 1GB
MaxMessageSize defines how large a message can be before we reject it
View Source
const MuxHeader = 2
MuxHeader is the header byte used in the TCP mux.
Variables ¶
View Source
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") // ErrInvalidConsistencyLevel is returned when parsing the string version // of a consistency level. ErrInvalidConsistencyLevel = errors.New("invalid consistency level") )
Functions ¶
Types ¶
type ConsistencyLevel ¶ added in v0.9.0
type ConsistencyLevel int
ConsistencyLevel represent a required replication criteria before a write can be returned as successful
const ( // ConsistencyLevelAny allows for hinted hand off, potentially no write happened yet ConsistencyLevelAny ConsistencyLevel = iota // ConsistencyLevelOne requires at least one data node acknowledged a write ConsistencyLevelOne // ConsistencyLevelOne requires a quorum of data nodes to acknowledge a write ConsistencyLevelQuorum // ConsistencyLevelAll requires all data nodes to acknowledge a write ConsistencyLevelAll )
func ParseConsistencyLevel ¶ added in v0.9.0
func ParseConsistencyLevel(level string) (ConsistencyLevel, error)
type PointsWriter ¶ added in v0.9.0
type PointsWriter struct {
Logger *log.Logger
MetaStore interface {
NodeID() uint64
Database(name string) (di *meta.DatabaseInfo, err error)
RetentionPolicy(database, policy string) (*meta.RetentionPolicyInfo, error)
CreateShardGroupIfNotExists(database, policy string, timestamp time.Time) (*meta.ShardGroupInfo, error)
ShardOwner(shardID uint64) (string, string, *meta.ShardGroupInfo)
}
TSDBStore interface {
CreateShard(database, retentionPolicy string, shardID uint64) error
WriteToShard(shardID uint64, points []tsdb.Point)