reader

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SentChunks = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "cortex",
		Name:      "reader_sent_chunks_total",
		Help:      "The total number of chunks sent by this reader.",
	})
)

Functions

This section is empty.

Types

type Config

type Config struct {
	StorageType   string                `yaml:"storage_type"`
	StorageConfig cortex_storage.Config `yaml:"storage"`
	NumWorkers    int                   `yaml:"num_workers"`
}

Config is a config for a Reader

type Planner

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

Planner plans the queries required for the migrations

func NewPlanner

func NewPlanner(cfg PlannerConfig) (*Planner, error)

NewPlanner returns a new planner struct

func (Planner) Plan

func (p Planner) Plan() []chunk.ScanRequest

Plan updates a Streamer with the correct queries for the planned migration

type PlannerConfig

type PlannerConfig struct {
	FirstShard int
	LastShard  int
	UserIDList string
	Tables     string
}

PlannerConfig is used to configure the Planner

func (*PlannerConfig) Register

func (cfg *PlannerConfig) Register(cmd *kingpin.CmdClause)

RegisterFlags adds the flags required to config this to the given FlagSet

type Reader

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

Reader collects and forwards chunks according to it's planner

func NewReader

func NewReader(cfg Config, plannerCfg PlannerConfig) (*Reader, error)

NewReader returns a Reader struct

func (*Reader) Err

func (r *Reader) Err() error

func (*Reader) Run

func (r *Reader) Run(ctx context.Context, outChan chan cortex_chunk.Chunk)

Run initializes the writer workers

func (*Reader) Stop

func (r *Reader) Stop()

Jump to

Keyboard shortcuts

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