-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstable: consolidate reader/writer options
There are currently three mechanisms to configure sstable.Reader or Writer: - most settings use `ReaderOptions`/`WriterOptions` - some settings use `ReaderOption`/`WriterOption`; some of these are kept private using a hook through the private package - some settings call a function that modifies a Writer, also through the private package This commit moves all settings to `ReaderOption`/`WriterOption` structs. Settings which are not allowed to be used outside Pebble are defined in `sstableinternal`, which prevents outside callers from constructing values for them.
- Loading branch information
1 parent
d28eb18
commit 963a635
Showing
28 changed files
with
325 additions
and
328 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
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 was deleted.
Oops, something went wrong.
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,37 @@ | ||
// Copyright 2024 The LevelDB-Go and Pebble Authors. All rights reserved. Use | ||
// of this source code is governed by a BSD-style license that can be found in | ||
// the LICENSE file. | ||
|
||
package sstableinternal | ||
|
||
import ( | ||
"github.com/cockroachdb/pebble/internal/base" | ||
"github.com/cockroachdb/pebble/internal/cache" | ||
) | ||
|
||
// CacheOptions contains the information needed to interact with the block | ||
// cache. | ||
type CacheOptions struct { | ||
// Cache can be nil, in which case no cache is used. When non-nil, the other | ||
// fields must be set accordingly. | ||
Cache *cache.Cache | ||
CacheID uint64 | ||
FileNum base.DiskFileNum | ||
} | ||
|
||
// ReaderOptions are fields of sstable.ReaderOptions that can only be set from | ||
// within the pebble package. | ||
type ReaderOptions struct { | ||
CacheOpts CacheOptions | ||
} | ||
|
||
// WriterOptions are fields of sstable.ReaderOptions that can only be set from | ||
// within the pebble package. | ||
type WriterOptions struct { | ||
CacheOpts CacheOptions | ||
|
||
// DisableKeyOrderChecks disables the checks that keys are added to an sstable | ||
// in order. It is intended for use only in the construction of invalid | ||
// sstables for testing. See tool/make_test_sstables.go. | ||
DisableKeyOrderChecks bool | ||
} |
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
Oops, something went wrong.