writer

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReceivedChunks = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: "cortex",
		Name:      "migration_writer_received_chunks_total",
		Help:      "The total number of chunks received by this writer",
	}, nil)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	StorageConfig storage.Config     `yaml:"storage"`
	SchemaConfig  chunk.SchemaConfig `yaml:"schema"`
	NumWorkers    int                `yaml:"num_workers"`
}

Config configures the Writer struct

type Mapper

type Mapper struct {
	Users map[string]string `yaml:"users,omitempty"`
}

Mapper is used to update and reencode chunks with new User Ids It can also serve as a struct to map other aspects of chunks in the future as more migration needs arise TODO: Add functionality to add/edit/drop labels

func (Mapper) MapChunk

func (u Mapper) MapChunk(chk chunk.Chunk) (chunk.Chunk, error)

MapChunk updates and maps values onto a chunkl

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer receives chunks and stores them in a storage backend

func NewWriter

func NewWriter(cfg Config, mapper Mapper) (*Writer, error)

NewWriter returns a Writer object

func (*Writer) Err

func (w *Writer) Err() error

func (*Writer) Run

func (w *Writer) Run(ctx context.Context, inChan chan chunk.Chunk)

Run initializes the writer workers

Jump to

Keyboard shortcuts

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