forked from cortexproject/cortex
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create feature flag to switch between current shuffle sharding group …
…planner and partition compaction group planner (cortexproject#6141) * Create feature flag to switch between current shuffle sharding group planner and partition compaction group planner Signed-off-by: Alex Le <[email protected]> * rename Signed-off-by: Alex Le <[email protected]> * update doc Signed-off-by: Alex Le <[email protected]> --------- Signed-off-by: Alex Le <[email protected]>
- Loading branch information
Showing
6 changed files
with
132 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package compactor | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/go-kit/log" | ||
"github.com/oklog/ulid" | ||
"github.com/thanos-io/objstore" | ||
"github.com/thanos-io/thanos/pkg/block/metadata" | ||
"github.com/thanos-io/thanos/pkg/compact" | ||
) | ||
|
||
type PartitionCompactionGrouper struct { | ||
ctx context.Context | ||
logger log.Logger | ||
bkt objstore.InstrumentedBucket | ||
} | ||
|
||
func NewPartitionCompactionGrouper( | ||
ctx context.Context, | ||
logger log.Logger, | ||
bkt objstore.InstrumentedBucket, | ||
) *PartitionCompactionGrouper { | ||
if logger == nil { | ||
logger = log.NewNopLogger() | ||
} | ||
|
||
return &PartitionCompactionGrouper{ | ||
ctx: ctx, | ||
logger: logger, | ||
bkt: bkt, | ||
} | ||
} | ||
|
||
// Groups function modified from https://github.com/cortexproject/cortex/pull/2616 | ||
func (g *PartitionCompactionGrouper) Groups(blocks map[ulid.ULID]*metadata.Meta) (res []*compact.Group, err error) { | ||
panic("PartitionCompactionGrouper not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package compactor | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/go-kit/log" | ||
"github.com/thanos-io/objstore" | ||
"github.com/thanos-io/thanos/pkg/block/metadata" | ||
) | ||
|
||
type PartitionCompactionPlanner struct { | ||
ctx context.Context | ||
bkt objstore.InstrumentedBucket | ||
logger log.Logger | ||
} | ||
|
||
func NewPartitionCompactionPlanner( | ||
ctx context.Context, | ||
bkt objstore.InstrumentedBucket, | ||
logger log.Logger, | ||
) *PartitionCompactionPlanner { | ||
return &PartitionCompactionPlanner{ | ||
ctx: ctx, | ||
bkt: bkt, | ||
logger: logger, | ||
} | ||
} | ||
|
||
func (p *PartitionCompactionPlanner) Plan(ctx context.Context, metasByMinTime []*metadata.Meta, errChan chan error, extensions any) ([]*metadata.Meta, error) { | ||
panic("PartitionCompactionPlanner not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters