MCPcopy Create free account
hub / github.com/cortexproject/cortex / NewShuffleShardingPlanner

Function NewShuffleShardingPlanner

pkg/compactor/shuffle_sharding_planner.go:29–53  ·  view source on GitHub ↗
(
	ctx context.Context,
	bkt objstore.InstrumentedBucket,
	logger log.Logger,
	ranges []int64,
	noCompBlocksFunc func() map[ulid.ULID]*metadata.NoCompactMark,
	ringLifecyclerID string,
	blockVisitMarkerTimeout time.Duration,
	blockVisitMarkerFileUpdateInterval time.Duration,
	blockVisitMarkerReadFailed prometheus.Counter,
	blockVisitMarkerWriteFailed prometheus.Counter,
)

Source from the content-addressed store, hash-verified

27}
28
29func NewShuffleShardingPlanner(
30 ctx context.Context,
31 bkt objstore.InstrumentedBucket,
32 logger log.Logger,
33 ranges []int64,
34 noCompBlocksFunc func() map[ulid.ULID]*metadata.NoCompactMark,
35 ringLifecyclerID string,
36 blockVisitMarkerTimeout time.Duration,
37 blockVisitMarkerFileUpdateInterval time.Duration,
38 blockVisitMarkerReadFailed prometheus.Counter,
39 blockVisitMarkerWriteFailed prometheus.Counter,
40) *ShuffleShardingPlanner {
41 return &ShuffleShardingPlanner{
42 ctx: ctx,
43 bkt: bkt,
44 logger: logger,
45 ranges: ranges,
46 noCompBlocksFunc: noCompBlocksFunc,
47 ringLifecyclerID: ringLifecyclerID,
48 blockVisitMarkerTimeout: blockVisitMarkerTimeout,
49 blockVisitMarkerFileUpdateInterval: blockVisitMarkerFileUpdateInterval,
50 blockVisitMarkerReadFailed: blockVisitMarkerReadFailed,
51 blockVisitMarkerWriteFailed: blockVisitMarkerWriteFailed,
52 }
53}
54
55func (p *ShuffleShardingPlanner) Plan(_ context.Context, metasByMinTime []*metadata.Meta, _ chan error, _ any) ([]*metadata.Meta, error) {
56 // Ensure all blocks fits within the largest range. This is a double check

Callers 2

compactor.goFile · 0.85

Calls

no outgoing calls

Tested by 1