netstorage

package
v1.79.4-cluster Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitStorageNodes

func InitStorageNodes(addrs []string, hashSeed uint64)

InitStorageNodes initializes vmstorage nodes' connections to the given addrs.

hashSeed is used for changing the distribution of input time series among addrs.

func PutInsertCtx

func PutInsertCtx(ctx *InsertCtx)

PutInsertCtx returns ctx to the pool.

ctx cannot be used after the call.

func Stop

func Stop()

Stop gracefully stops netstorage.

Types

type InsertCtx

type InsertCtx struct {
	Labels        sortedLabels
	MetricNameBuf []byte
	// contains filtered or unexported fields
}

InsertCtx is a generic context for inserting data.

InsertCtx.Reset must be called before the first usage.

func GetInsertCtx

func GetInsertCtx() *InsertCtx

GetInsertCtx returns InsertCtx from the pool.

Call PutInsertCtx for returning it to the pool.

func (*InsertCtx) AddLabel

func (ctx *InsertCtx) AddLabel(name, value string)

AddLabel adds (name, value) label to ctx.Labels.

name and value must exist until ctx.Labels is used.

func (*InsertCtx) AddLabelBytes

func (ctx *InsertCtx) AddLabelBytes(name, value []byte)

AddLabelBytes adds (name, value) label to ctx.Labels.

name and value must exist until ctx.Labels is used.

func (*InsertCtx) ApplyRelabeling

func (ctx *InsertCtx) ApplyRelabeling()

ApplyRelabeling applies relabeling to ctx.Labels.

func (*InsertCtx) FlushBufs

func (ctx *InsertCtx) FlushBufs() error

FlushBufs flushes ctx bufs to remote storage nodes.

func (*InsertCtx) GetStorageNodeIdx

func (ctx *InsertCtx) GetStorageNodeIdx(at *auth.Token, labels []prompb.Label) int

GetStorageNodeIdx returns storage node index for the given at and labels.

The returned index must be passed to WriteDataPoint.

func (*InsertCtx) Reset

func (ctx *InsertCtx) Reset()

Reset resets ctx.

func (*InsertCtx) SortLabelsIfNeeded

func (ctx *InsertCtx) SortLabelsIfNeeded()

SortLabelsIfNeeded sorts labels if -sortLabels command-line flag is set

func (*InsertCtx) WriteDataPoint

func (ctx *InsertCtx) WriteDataPoint(at *auth.Token, labels []prompb.Label, timestamp int64, value float64) error

WriteDataPoint writes (timestamp, value) data point with the given at and labels to ctx buffer.

func (*InsertCtx) WriteDataPointExt

func (ctx *InsertCtx) WriteDataPointExt(at *auth.Token, storageNodeIdx int, metricNameRaw []byte, timestamp int64, value float64) error

WriteDataPointExt writes the given metricNameRaw with (timestmap, value) to ctx buffer with the given storageNodeIdx.

Jump to

Keyboard shortcuts

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