Skip to content

Commit

Permalink
Rename methods and fields for clarity about disablement
Browse files Browse the repository at this point in the history
  • Loading branch information
zalegrala committed Aug 15, 2024
1 parent 4e2bf90 commit 4edf45a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions modules/compactor/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ func (c *Compactor) BlockRetentionForTenant(tenantID string) time.Duration {
return c.overrides.BlockRetention(tenantID)
}

// BlockRetentionForTenant implements CompactorOverrides
// DisabledForTenant implements CompactorOverrides
func (c *Compactor) DisabledForTenant(tenantID string) bool {
return c.overrides.Disabled(tenantID)
return c.overrides.CompactionDisabled(tenantID)
}

func (c *Compactor) MaxBytesPerTraceForTenant(tenantID string) int {
Expand Down
6 changes: 3 additions & 3 deletions modules/overrides/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ type ReadOverrides struct {

type CompactionOverrides struct {
// Compactor enforced overrides.
BlockRetention model.Duration `yaml:"block_retention,omitempty" json:"block_retention,omitempty"`
CompactionWindow model.Duration `yaml:"compaction_window,omitempty" json:"compaction_window,omitempty"`
Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"`
BlockRetention model.Duration `yaml:"block_retention,omitempty" json:"block_retention,omitempty"`
CompactionWindow model.Duration `yaml:"compaction_window,omitempty" json:"compaction_window,omitempty"`
CompactionDisabled bool `yaml:"compaction_disabled,omitempty" json:"compaction_disabled,omitempty"`
}

type GlobalOverrides struct {
Expand Down
12 changes: 6 additions & 6 deletions modules/overrides/config_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ type LegacyOverrides struct {
MetricsGeneratorIngestionSlack time.Duration `yaml:"metrics_generator_ingestion_time_range_slack" json:"metrics_generator_ingestion_time_range_slack"`

// Compactor enforced limits.
BlockRetention model.Duration `yaml:"block_retention" json:"block_retention"`
Disabled bool `yaml:"compaction_disabled" json:"compaction_disabled"`
CompactionWindow model.Duration `yaml:"compaction_window" json:"compaction_window"`
BlockRetention model.Duration `yaml:"block_retention" json:"block_retention"`
CompactionDisabled bool `yaml:"compaction_disabled" json:"compaction_disabled"`
CompactionWindow model.Duration `yaml:"compaction_window" json:"compaction_window"`

// Querier and Ingester enforced limits.
MaxBytesPerTagValuesQuery int `yaml:"max_bytes_per_tag_values_query" json:"max_bytes_per_tag_values_query"`
Expand Down Expand Up @@ -156,9 +156,9 @@ func (l *LegacyOverrides) toNewLimits() Overrides {
UnsafeQueryHints: l.UnsafeQueryHints,
},
Compaction: CompactionOverrides{
BlockRetention: l.BlockRetention,
Disabled: l.Disabled,
CompactionWindow: l.CompactionWindow,
BlockRetention: l.BlockRetention,
CompactionDisabled: l.CompactionDisabled,
CompactionWindow: l.CompactionWindow,
},
MetricsGenerator: MetricsGeneratorOverrides{
RingSize: l.MetricsGeneratorRingSize,
Expand Down
2 changes: 1 addition & 1 deletion modules/overrides/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type Interface interface {
MetricsGeneratorProcessorServiceGraphsEnableVirtualNodeLabel(userID string) bool
MetricsGeneratorProcessorSpanMetricsTargetInfoExcludedDimensions(userID string) []string
BlockRetention(userID string) time.Duration
Disabled(userID string) bool
CompactionDisabled(userID string) bool
MaxSearchDuration(userID string) time.Duration
MaxMetricsDuration(userID string) time.Duration
DedicatedColumns(userID string) backend.DedicatedColumns
Expand Down
6 changes: 3 additions & 3 deletions modules/overrides/runtime_config_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ func (o *runtimeConfigOverridesManager) BlockRetention(userID string) time.Durat
return time.Duration(o.getOverridesForUser(userID).Compaction.BlockRetention)
}

// Disabled will not compact tenants which have this enabled.
func (o *runtimeConfigOverridesManager) Disabled(userID string) bool {
return o.getOverridesForUser(userID).Compaction.Disabled
// CompactionDisabled will not compact tenants which have this enabled.
func (o *runtimeConfigOverridesManager) CompactionDisabled(userID string) bool {
return o.getOverridesForUser(userID).Compaction.CompactionDisabled
}

func (o *runtimeConfigOverridesManager) DedicatedColumns(userID string) backend.DedicatedColumns {
Expand Down

0 comments on commit 4edf45a

Please sign in to comment.