util

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildObjectKey

func BuildObjectKey(tableName, uploader, dbName string) string

func CompressFile

func CompressFile(src, dest string) error

func DoParallelQueries

func DoParallelQueries(ctx context.Context, tableQuerier TableQuerier, queries []chunk.IndexQuery, callback chunk_util.Callback) error

func GetDBNameFromObjectKey

func GetDBNameFromObjectKey(objectKey string) (string, error)

func GetFileFromStorage

func GetFileFromStorage(ctx context.Context, storageClient StorageClient, objectKey, destination string) error

GetFileFromStorage downloads a file from storage to given location.

func QueriesByTable

func QueriesByTable(queries []chunk.IndexQuery) map[string][]chunk.IndexQuery

QueriesByTable groups and returns queries by tables.

Types

type IndexDeduper

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

IndexDeduper should always be used on table level not the whole query level because it just looks at range values which can be repeated across tables Cortex anyways dedupes entries accross tables

func NewIndexDeduper

func NewIndexDeduper(callback chunk_util.Callback) *IndexDeduper

func (*IndexDeduper) Callback

func (i *IndexDeduper) Callback(query chunk.IndexQuery, batch chunk.ReadBatch) bool

type StorageClient

type StorageClient interface {
	GetObject(ctx context.Context, objectKey string) (io.ReadCloser, error)
}

type TableQuerier

type TableQuerier interface {
	MultiQueries(ctx context.Context, queries []chunk.IndexQuery, callback chunk_util.Callback) error
}

Jump to

Keyboard shortcuts

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