blocklist

package
v0.0.0-...-39c03fc Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OwnsNothingSharder = ownsNothingSharder{}

OwnsNothingSharder owns nothing. You do not want this developer on your team.

Functions

This section is empty.

Types

type JobSharder

type JobSharder interface {
	// Owns is used to ask if a job, identified by a string, is owned by this process
	Owns(string) bool
}

JobSharder is used to determine if a particular job is owned by this process

type List

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

List controls access to a per tenant blocklist and compacted blocklist

func New

func New() *List

func (*List) ApplyPollResults

func (l *List) ApplyPollResults(m PerTenant, c PerTenantCompacted)

ApplyPollResults applies the PerTenant and PerTenantCompacted maps to this blocklist Note that it also applies any known local changes and then wipes them out to be restored in the next polling cycle.

func (*List) CompactedMetas

func (l *List) CompactedMetas(tenantID string) []*backend.CompactedBlockMeta

func (*List) Metas

func (l *List) Metas(tenantID string) []*backend.BlockMeta

func (*List) Tenants

func (l *List) Tenants() []string

Tenants returns a slice of tenant ids with metas (compacted metas are ignored.)

func (*List) Update

func (l *List) Update(tenantID string, add []*backend.BlockMeta, remove []*backend.BlockMeta, compactedAdd []*backend.CompactedBlockMeta, compactedRemove []*backend.CompactedBlockMeta)

Update Adds and removes regular or compacted blocks from the in-memory blocklist. Changes are temporary and will be preserved only for one poll

type PerTenant

type PerTenant map[string][]*backend.BlockMeta

PerTenant is a map of tenant ids to backend.BlockMetas

type PerTenantCompacted

type PerTenantCompacted map[string][]*backend.CompactedBlockMeta

PerTenantCompacted is a map of tenant ids to backend.CompactedBlockMetas

type Poller

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

Poller retrieves the blocklist

func NewPoller

func NewPoller(cfg *PollerConfig, sharder JobSharder, reader backend.Reader, compactor backend.Compactor, writer backend.Writer, logger log.Logger) *Poller

NewPoller creates the Poller

func (*Poller) Do

Do does the doing of getting a blocklist

type PollerConfig

type PollerConfig struct {
	PollConcurrency     uint
	PollFallback        bool
	TenantIndexBuilders int
	StaleTenantIndex    time.Duration
	PollJitterMs        int
}

Config is used to configure the poller

Jump to

Keyboard shortcuts

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