strategies

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SplitKeyspaceStrategyName          = "split_keyspace_by_factor"
	SplitBySeriesChunkSizeStrategyName = "split_by_series_chunks_size"
)

Variables

This section is empty.

Functions

func FindGapsInFingerprintBounds

func FindGapsInFingerprintBounds(ownershipRange v1.FingerprintBounds, metas []v1.FingerprintBounds) (gaps []v1.FingerprintBounds, err error)

func SplitFingerprintKeyspaceByFactor

func SplitFingerprintKeyspaceByFactor(factor int) []v1.FingerprintBounds

SplitFingerprintKeyspaceByFactor splits the keyspace covered by model.Fingerprint into contiguous non-overlapping ranges.

Types

type ChunkSizeStrategy

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

func NewChunkSizeStrategy

func NewChunkSizeStrategy(
	limits ChunkSizeStrategyLimits,
	logger log.Logger,
) (*ChunkSizeStrategy, error)

func (*ChunkSizeStrategy) Name

func (s *ChunkSizeStrategy) Name() string

func (*ChunkSizeStrategy) Plan

func (s *ChunkSizeStrategy) Plan(
	ctx context.Context,
	table config.DayTable,
	tenant string,
	tsdbs TSDBSet,
	metas []bloomshipper.Meta,
) ([]*protos.Task, error)

type ChunkSizeStrategyLimits

type ChunkSizeStrategyLimits interface {
	BloomTaskTargetSeriesChunksSizeBytes(tenantID string) uint64
}

type Limits

type Limits interface {
	BloomPlanningStrategy(tenantID string) string
	SplitKeyspaceStrategyLimits
	ChunkSizeStrategyLimits
}

type PlanningStrategy

type PlanningStrategy interface {
	Name() string
	// Plan returns a set of tasks for a given tenant-table tuple and TSDBs.
	Plan(ctx context.Context, table config.DayTable, tenant string, tsdbs TSDBSet, metas []bloomshipper.Meta) ([]*protos.Task, error)
}

func NewStrategy

func NewStrategy(
	tenantID string,
	limits Limits,
	logger log.Logger,
) (PlanningStrategy, error)

type SplitKeyspaceStrategy

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

func NewSplitKeyspaceStrategy

func NewSplitKeyspaceStrategy(
	limits SplitKeyspaceStrategyLimits,
	logger log.Logger,
) (*SplitKeyspaceStrategy, error)

func (*SplitKeyspaceStrategy) Name

func (s *SplitKeyspaceStrategy) Name() string

func (*SplitKeyspaceStrategy) Plan

func (s *SplitKeyspaceStrategy) Plan(
	ctx context.Context,
	table config.DayTable,
	tenant string,
	tsdbs TSDBSet,
	metas []bloomshipper.Meta,
) ([]*protos.Task, error)

type SplitKeyspaceStrategyLimits

type SplitKeyspaceStrategyLimits interface {
	BloomSplitSeriesKeyspaceBy(tenantID string) int
}

Jump to

Keyboard shortcuts

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