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 4edf45a commit 736cbd9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/compactor/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ func (c *Compactor) BlockRetentionForTenant(tenantID string) time.Duration {
return c.overrides.BlockRetention(tenantID)
}

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

Expand Down
2 changes: 1 addition & 1 deletion tempodb/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (rw *readerWriter) doCompaction(ctx context.Context) {
tenantID := tenants[rw.compactorTenantOffset]

// Skip compaction for tenants which have it disabled.
if rw.compactorOverrides.DisabledForTenant(tenantID) {
if rw.compactorOverrides.CompactionDisabledForTenant(tenantID) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion tempodb/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (m *mockOverrides) BlockRetentionForTenant(_ string) time.Duration {
return m.blockRetention
}

func (m *mockOverrides) DisabledForTenant(_ string) bool {
func (m *mockOverrides) CompactionDisabledForTenant(_ string) bool {
return m.disabled
}

Expand Down
2 changes: 1 addition & 1 deletion tempodb/tempodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type CompactorSharder interface {

type CompactorOverrides interface {
BlockRetentionForTenant(tenantID string) time.Duration
DisabledForTenant(tenantID string) bool
CompactionDisabledForTenant(tenantID string) bool
MaxBytesPerTraceForTenant(tenantID string) int
MaxCompactionRangeForTenant(tenantID string) time.Duration
}
Expand Down

0 comments on commit 736cbd9

Please sign in to comment.