Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed May 15, 2024
1 parent 7a79804 commit 80979a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions database/pebble/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ const (
// pebbleByteOverHead is the number of bytes of constant overhead that
// should be added to a batch size per operation.
pebbleByteOverHead = 8

defaultCacheSize = 512 * units.MiB
)

var (
_ database.Database = (*Database)(nil)

errInvalidOperation = errors.New("invalid operation")

defaultCacheSize = 512 * units.MiB
DefaultConfig = Config{
DefaultConfig = Config{
CacheSize: defaultCacheSize,
BytesPerSync: 512 * units.KiB,
WALBytesPerSync: 0, // Default to no background syncing.
Expand All @@ -53,7 +54,7 @@ type Database struct {
}

type Config struct {
CacheSize int `json:"cacheSize"`
CacheSize int64 `json:"cacheSize"`
BytesPerSync int `json:"bytesPerSync"`
WALBytesPerSync int `json:"walBytesPerSync"` // 0 means no background syncing
MemTableStopWritesThreshold int `json:"memTableStopWritesThreshold"`
Expand All @@ -72,7 +73,7 @@ func New(file string, configBytes []byte, log logging.Logger, _ string, _ promet
}

opts := &pebble.Options{
Cache: pebble.NewCache(int64(cfg.CacheSize)),
Cache: pebble.NewCache(cfg.CacheSize),
BytesPerSync: cfg.BytesPerSync,
Comparer: pebble.DefaultComparer,
WALBytesPerSync: cfg.WALBytesPerSync,
Expand Down

0 comments on commit 80979a7

Please sign in to comment.