Skip to content

Commit

Permalink
use the constant manifest.NumLevels instead of literal value
Browse files Browse the repository at this point in the history
  • Loading branch information
lonng authored and jbowens committed Oct 17, 2023
1 parent 94ccf35 commit 5807b59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compaction_picker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ func pickAutoLPositive(
vers *version,
cInfo candidateLevelInfo,
baseLevel int,
levelMaxBytes [7]int64,
levelMaxBytes [numLevels]int64,
) (pc *pickedCompaction) {
if cInfo.level == 0 {
panic("pebble: pickAutoLPositive called for L0")
Expand Down
7 changes: 5 additions & 2 deletions tool/logs/compaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ import (

"github.com/cockroachdb/errors"
"github.com/cockroachdb/pebble/internal/humanize"
"github.com/cockroachdb/pebble/internal/manifest"
"github.com/spf13/cobra"
)

const numLevels = manifest.NumLevels

var (
// Captures a common logging prefix that can be used as the context for the
// surrounding information captured by other expressions. Example:
Expand Down Expand Up @@ -514,8 +517,8 @@ type windowSummary struct {
compactionBytesMoved map[fromTo]uint64
compactionBytesDel map[fromTo]uint64
compactionTime map[fromTo]time.Duration
ingestedCount [7]int
ingestedBytes [7]uint64
ingestedCount [numLevels]int
ingestedBytes [numLevels]uint64
readAmps []readAmp
longRunning []event
}
Expand Down

0 comments on commit 5807b59

Please sign in to comment.