Make ImmutableOptions struct that inherits from ImmutableCFOptions and ImmutableDBOptions (#8262)
Summary: The ImmutableCFOptions contained a bunch of fields that belonged to the ImmutableDBOptions. This change cleans that up by introducing an ImmutableOptions struct. Following the pattern of Options struct, this class inherits from the DB and CFOption structs (of the Immutable form). Only one structural change (the ImmutableCFOptions::fs was changed to a shared_ptr from a raw one) is in this PR. All of the other changes involve moving the member variables from the ImmutableCFOptions into the ImmutableOptions and changing member variables or function parameters as required for compilation purposes. Follow-on PRs may do a further clean-up of the code, such as renaming variables (such as "ImmutableOptions cf_options") and potentially eliminating un-needed function parameters (there is no longer a need to pass both an ImmutableDBOptions and an ImmutableOptions to a function). Pull Request resolved: https://github.com/facebook/rocksdb/pull/8262 Reviewed By: pdillinger Differential Revision: D28226540 Pulled By: mrambacher fbshipit-source-id: 18ae71eadc879dedbe38b1eb8e6f9ff5c7147dbf
This commit is contained in:
parent
0f42e50fec
commit
8948dc8524
@ -32,7 +32,7 @@ Status ArenaWrappedDBIter::GetProperty(std::string prop_name,
|
||||
|
||||
void ArenaWrappedDBIter::Init(
|
||||
Env* env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options, const Version* version,
|
||||
const SequenceNumber& sequence, uint64_t max_sequential_skip_in_iteration,
|
||||
uint64_t version_number, ReadCallback* read_callback, DBImpl* db_impl,
|
||||
@ -89,7 +89,7 @@ Status ArenaWrappedDBIter::Refresh() {
|
||||
|
||||
ArenaWrappedDBIter* NewArenaWrappedDbIterator(
|
||||
Env* env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options, const Version* version,
|
||||
const SequenceNumber& sequence, uint64_t max_sequential_skip_in_iterations,
|
||||
uint64_t version_number, ReadCallback* read_callback, DBImpl* db_impl,
|
||||
|
@ -72,7 +72,7 @@ class ArenaWrappedDBIter : public Iterator {
|
||||
Status Refresh() override;
|
||||
|
||||
void Init(Env* env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options, const Version* version,
|
||||
const SequenceNumber& sequence,
|
||||
uint64_t max_sequential_skip_in_iterations, uint64_t version_number,
|
||||
@ -106,7 +106,7 @@ class ArenaWrappedDBIter : public Iterator {
|
||||
// be supported.
|
||||
extern ArenaWrappedDBIter* NewArenaWrappedDbIterator(
|
||||
Env* env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options, const Version* version,
|
||||
const SequenceNumber& sequence, uint64_t max_sequential_skip_in_iterations,
|
||||
uint64_t version_number, ReadCallback* read_callback,
|
||||
|
@ -29,7 +29,7 @@ namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
BlobFileBuilder::BlobFileBuilder(
|
||||
VersionSet* versions, FileSystem* fs,
|
||||
const ImmutableCFOptions* immutable_cf_options,
|
||||
const ImmutableOptions* immutable_cf_options,
|
||||
const MutableCFOptions* mutable_cf_options, const FileOptions* file_options,
|
||||
int job_id, uint32_t column_family_id,
|
||||
const std::string& column_family_name, Env::IOPriority io_priority,
|
||||
@ -46,7 +46,7 @@ BlobFileBuilder::BlobFileBuilder(
|
||||
|
||||
BlobFileBuilder::BlobFileBuilder(
|
||||
std::function<uint64_t()> file_number_generator, FileSystem* fs,
|
||||
const ImmutableCFOptions* immutable_cf_options,
|
||||
const ImmutableOptions* immutable_cf_options,
|
||||
const MutableCFOptions* mutable_cf_options, const FileOptions* file_options,
|
||||
int job_id, uint32_t column_family_id,
|
||||
const std::string& column_family_name, Env::IOPriority io_priority,
|
||||
|
@ -19,7 +19,7 @@ namespace ROCKSDB_NAMESPACE {
|
||||
class VersionSet;
|
||||
class FileSystem;
|
||||
class SystemClock;
|
||||
struct ImmutableCFOptions;
|
||||
struct ImmutableOptions;
|
||||
struct MutableCFOptions;
|
||||
struct FileOptions;
|
||||
class BlobFileAddition;
|
||||
@ -32,7 +32,7 @@ class BlobFileCompletionCallback;
|
||||
class BlobFileBuilder {
|
||||
public:
|
||||
BlobFileBuilder(VersionSet* versions, FileSystem* fs,
|
||||
const ImmutableCFOptions* immutable_cf_options,
|
||||
const ImmutableOptions* immutable_options,
|
||||
const MutableCFOptions* mutable_cf_options,
|
||||
const FileOptions* file_options, int job_id,
|
||||
uint32_t column_family_id,
|
||||
@ -45,8 +45,7 @@ class BlobFileBuilder {
|
||||
std::vector<BlobFileAddition>* blob_file_additions);
|
||||
|
||||
BlobFileBuilder(std::function<uint64_t()> file_number_generator,
|
||||
FileSystem* fs,
|
||||
const ImmutableCFOptions* immutable_cf_options,
|
||||
FileSystem* fs, const ImmutableOptions* immutable_options,
|
||||
const MutableCFOptions* mutable_cf_options,
|
||||
const FileOptions* file_options, int job_id,
|
||||
uint32_t column_family_id,
|
||||
@ -78,7 +77,7 @@ class BlobFileBuilder {
|
||||
|
||||
std::function<uint64_t()> file_number_generator_;
|
||||
FileSystem* fs_;
|
||||
const ImmutableCFOptions* immutable_cf_options_;
|
||||
const ImmutableOptions* immutable_cf_options_;
|
||||
uint64_t min_blob_size_;
|
||||
uint64_t blob_file_size_;
|
||||
CompressionType blob_compression_type_;
|
||||
|
@ -129,7 +129,7 @@ TEST_F(BlobFileBuilderTest, BuildAndCheckOneFile) {
|
||||
options.enable_blob_files = true;
|
||||
options.env = &mock_env_;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
@ -214,7 +214,7 @@ TEST_F(BlobFileBuilderTest, BuildAndCheckMultipleFiles) {
|
||||
options.blob_file_size = value_size;
|
||||
options.env = &mock_env_;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
@ -301,7 +301,7 @@ TEST_F(BlobFileBuilderTest, InlinedValues) {
|
||||
options.min_blob_size = 1024;
|
||||
options.env = &mock_env_;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
@ -355,7 +355,7 @@ TEST_F(BlobFileBuilderTest, Compression) {
|
||||
options.blob_compression_type = kSnappyCompression;
|
||||
options.env = &mock_env_;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
@ -438,7 +438,7 @@ TEST_F(BlobFileBuilderTest, CompressionError) {
|
||||
options.enable_blob_files = true;
|
||||
options.blob_compression_type = kSnappyCompression;
|
||||
options.env = &mock_env_;
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
@ -517,7 +517,7 @@ TEST_F(BlobFileBuilderTest, Checksum) {
|
||||
std::make_shared<DummyFileChecksumGenFactory>();
|
||||
options.env = &mock_env_;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
@ -614,7 +614,7 @@ TEST_P(BlobFileBuilderIOErrorTest, IOError) {
|
||||
options.blob_file_size = value_size;
|
||||
options.env = &mock_env_;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
MutableCFOptions mutable_cf_options(options);
|
||||
|
||||
constexpr int job_id = 1;
|
||||
|
@ -19,14 +19,14 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
BlobFileCache::BlobFileCache(Cache* cache,
|
||||
const ImmutableCFOptions* immutable_cf_options,
|
||||
const ImmutableOptions* immutable_options,
|
||||
const FileOptions* file_options,
|
||||
uint32_t column_family_id,
|
||||
HistogramImpl* blob_file_read_hist,
|
||||
const std::shared_ptr<IOTracer>& io_tracer)
|
||||
: cache_(cache),
|
||||
mutex_(kNumberOfMutexStripes, kGetSliceNPHash64UnseededFnPtr),
|
||||
immutable_cf_options_(immutable_cf_options),
|
||||
immutable_cf_options_(immutable_options),
|
||||
file_options_(file_options),
|
||||
column_family_id_(column_family_id),
|
||||
blob_file_read_hist_(blob_file_read_hist),
|
||||
|
@ -14,7 +14,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
class Cache;
|
||||
struct ImmutableCFOptions;
|
||||
struct ImmutableOptions;
|
||||
struct FileOptions;
|
||||
class HistogramImpl;
|
||||
class Status;
|
||||
@ -24,7 +24,7 @@ class IOTracer;
|
||||
|
||||
class BlobFileCache {
|
||||
public:
|
||||
BlobFileCache(Cache* cache, const ImmutableCFOptions* immutable_cf_options,
|
||||
BlobFileCache(Cache* cache, const ImmutableOptions* immutable_options,
|
||||
const FileOptions* file_options, uint32_t column_family_id,
|
||||
HistogramImpl* blob_file_read_hist,
|
||||
const std::shared_ptr<IOTracer>& io_tracer);
|
||||
@ -40,7 +40,7 @@ class BlobFileCache {
|
||||
// Note: mutex_ below is used to guard against multiple threads racing to open
|
||||
// the same file.
|
||||
Striped<port::Mutex, Slice> mutex_;
|
||||
const ImmutableCFOptions* immutable_cf_options_;
|
||||
const ImmutableOptions* immutable_cf_options_;
|
||||
const FileOptions* file_options_;
|
||||
uint32_t column_family_id_;
|
||||
HistogramImpl* blob_file_read_hist_;
|
||||
|
@ -29,7 +29,7 @@ namespace {
|
||||
|
||||
// Creates a test blob file with a single blob in it.
|
||||
void WriteBlobFile(uint32_t column_family_id,
|
||||
const ImmutableCFOptions& immutable_cf_options,
|
||||
const ImmutableOptions& immutable_cf_options,
|
||||
uint64_t blob_file_number) {
|
||||
assert(!immutable_cf_options.cf_paths.empty());
|
||||
|
||||
@ -37,8 +37,8 @@ void WriteBlobFile(uint32_t column_family_id,
|
||||
immutable_cf_options.cf_paths.front().path, blob_file_number);
|
||||
|
||||
std::unique_ptr<FSWritableFile> file;
|
||||
ASSERT_OK(NewWritableFile(immutable_cf_options.fs, blob_file_path, &file,
|
||||
FileOptions()));
|
||||
ASSERT_OK(NewWritableFile(immutable_cf_options.fs.get(), blob_file_path,
|
||||
&file, FileOptions()));
|
||||
|
||||
std::unique_ptr<WritableFileWriter> file_writer(
|
||||
new WritableFileWriter(std::move(file), blob_file_path, FileOptions(),
|
||||
@ -100,7 +100,7 @@ TEST_F(BlobFileCacheTest, GetBlobFileReader) {
|
||||
options.enable_blob_files = true;
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
constexpr uint64_t blob_file_number = 123;
|
||||
|
||||
WriteBlobFile(column_family_id, immutable_cf_options, blob_file_number);
|
||||
@ -145,7 +145,7 @@ TEST_F(BlobFileCacheTest, GetBlobFileReader_Race) {
|
||||
options.enable_blob_files = true;
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
constexpr uint64_t blob_file_number = 123;
|
||||
|
||||
WriteBlobFile(column_family_id, immutable_cf_options, blob_file_number);
|
||||
@ -199,7 +199,7 @@ TEST_F(BlobFileCacheTest, GetBlobFileReader_IOError) {
|
||||
constexpr size_t capacity = 10;
|
||||
std::shared_ptr<Cache> backing_cache = NewLRUCache(capacity);
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
FileOptions file_options;
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr HistogramImpl* blob_file_read_hist = nullptr;
|
||||
@ -231,7 +231,7 @@ TEST_F(BlobFileCacheTest, GetBlobFileReader_CacheFull) {
|
||||
options.enable_blob_files = true;
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
constexpr uint64_t blob_file_number = 123;
|
||||
|
||||
WriteBlobFile(column_family_id, immutable_cf_options, blob_file_number);
|
||||
|
@ -21,7 +21,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
Status BlobFileReader::Create(
|
||||
const ImmutableCFOptions& immutable_cf_options,
|
||||
const ImmutableOptions& immutable_cf_options,
|
||||
const FileOptions& file_options, uint32_t column_family_id,
|
||||
HistogramImpl* blob_file_read_hist, uint64_t blob_file_number,
|
||||
const std::shared_ptr<IOTracer>& io_tracer,
|
||||
@ -67,10 +67,10 @@ Status BlobFileReader::Create(
|
||||
}
|
||||
|
||||
Status BlobFileReader::OpenFile(
|
||||
const ImmutableCFOptions& immutable_cf_options,
|
||||
const FileOptions& file_opts, HistogramImpl* blob_file_read_hist,
|
||||
uint64_t blob_file_number, const std::shared_ptr<IOTracer>& io_tracer,
|
||||
uint64_t* file_size, std::unique_ptr<RandomAccessFileReader>* file_reader) {
|
||||
const ImmutableOptions& immutable_cf_options, const FileOptions& file_opts,
|
||||
HistogramImpl* blob_file_read_hist, uint64_t blob_file_number,
|
||||
const std::shared_ptr<IOTracer>& io_tracer, uint64_t* file_size,
|
||||
std::unique_ptr<RandomAccessFileReader>* file_reader) {
|
||||
assert(file_size);
|
||||
assert(file_reader);
|
||||
|
||||
@ -80,7 +80,7 @@ Status BlobFileReader::OpenFile(
|
||||
const std::string blob_file_path =
|
||||
BlobFileName(cf_paths.front().path, blob_file_number);
|
||||
|
||||
FileSystem* const fs = immutable_cf_options.fs;
|
||||
FileSystem* const fs = immutable_cf_options.fs.get();
|
||||
assert(fs);
|
||||
|
||||
constexpr IODebugContext* dbg = nullptr;
|
||||
|
@ -15,7 +15,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
class Status;
|
||||
struct ImmutableCFOptions;
|
||||
struct ImmutableOptions;
|
||||
struct FileOptions;
|
||||
class HistogramImpl;
|
||||
struct ReadOptions;
|
||||
@ -24,7 +24,7 @@ class PinnableSlice;
|
||||
|
||||
class BlobFileReader {
|
||||
public:
|
||||
static Status Create(const ImmutableCFOptions& immutable_cf_options,
|
||||
static Status Create(const ImmutableOptions& immutable_options,
|
||||
const FileOptions& file_options,
|
||||
uint32_t column_family_id,
|
||||
HistogramImpl* blob_file_read_hist,
|
||||
@ -46,7 +46,7 @@ class BlobFileReader {
|
||||
BlobFileReader(std::unique_ptr<RandomAccessFileReader>&& file_reader,
|
||||
uint64_t file_size, CompressionType compression_type);
|
||||
|
||||
static Status OpenFile(const ImmutableCFOptions& immutable_cf_options,
|
||||
static Status OpenFile(const ImmutableOptions& immutable_options,
|
||||
const FileOptions& file_opts,
|
||||
HistogramImpl* blob_file_read_hist,
|
||||
uint64_t blob_file_number,
|
||||
|
@ -30,7 +30,7 @@ namespace {
|
||||
// Creates a test blob file with a single blob in it. Note: this method
|
||||
// makes it possible to test various corner cases by allowing the caller
|
||||
// to specify the contents of various blob file header/footer fields.
|
||||
void WriteBlobFile(const ImmutableCFOptions& immutable_cf_options,
|
||||
void WriteBlobFile(const ImmutableOptions& immutable_cf_options,
|
||||
uint32_t column_family_id, bool has_ttl,
|
||||
const ExpirationRange& expiration_range_header,
|
||||
const ExpirationRange& expiration_range_footer,
|
||||
@ -45,8 +45,8 @@ void WriteBlobFile(const ImmutableCFOptions& immutable_cf_options,
|
||||
immutable_cf_options.cf_paths.front().path, blob_file_number);
|
||||
|
||||
std::unique_ptr<FSWritableFile> file;
|
||||
ASSERT_OK(NewWritableFile(immutable_cf_options.fs, blob_file_path, &file,
|
||||
FileOptions()));
|
||||
ASSERT_OK(NewWritableFile(immutable_cf_options.fs.get(), blob_file_path,
|
||||
&file, FileOptions()));
|
||||
|
||||
std::unique_ptr<WritableFileWriter> file_writer(
|
||||
new WritableFileWriter(std::move(file), blob_file_path, FileOptions(),
|
||||
@ -122,7 +122,7 @@ TEST_F(BlobFileReaderTest, CreateReaderAndGetBlob) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -262,7 +262,7 @@ TEST_F(BlobFileReaderTest, Malformed) {
|
||||
test::PerThreadDBPath(&mock_env_, "BlobFileReaderTest_Malformed"), 0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr uint64_t blob_file_number = 1;
|
||||
@ -275,8 +275,8 @@ TEST_F(BlobFileReaderTest, Malformed) {
|
||||
immutable_cf_options.cf_paths.front().path, blob_file_number);
|
||||
|
||||
std::unique_ptr<FSWritableFile> file;
|
||||
ASSERT_OK(NewWritableFile(immutable_cf_options.fs, blob_file_path, &file,
|
||||
FileOptions()));
|
||||
ASSERT_OK(NewWritableFile(immutable_cf_options.fs.get(), blob_file_path,
|
||||
&file, FileOptions()));
|
||||
|
||||
std::unique_ptr<WritableFileWriter> file_writer(
|
||||
new WritableFileWriter(std::move(file), blob_file_path, FileOptions(),
|
||||
@ -314,7 +314,7 @@ TEST_F(BlobFileReaderTest, TTL) {
|
||||
test::PerThreadDBPath(&mock_env_, "BlobFileReaderTest_TTL"), 0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = true;
|
||||
@ -350,7 +350,7 @@ TEST_F(BlobFileReaderTest, ExpirationRangeInHeader) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -389,7 +389,7 @@ TEST_F(BlobFileReaderTest, ExpirationRangeInFooter) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -428,7 +428,7 @@ TEST_F(BlobFileReaderTest, IncorrectColumnFamily) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -464,7 +464,7 @@ TEST_F(BlobFileReaderTest, BlobCRCError) {
|
||||
test::PerThreadDBPath(&mock_env_, "BlobFileReaderTest_BlobCRCError"), 0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -522,7 +522,7 @@ TEST_F(BlobFileReaderTest, Compression) {
|
||||
test::PerThreadDBPath(&mock_env_, "BlobFileReaderTest_Compression"), 0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -590,7 +590,7 @@ TEST_F(BlobFileReaderTest, UncompressionError) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -671,7 +671,7 @@ TEST_P(BlobFileReaderIOErrorTest, IOError) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
@ -749,7 +749,7 @@ TEST_P(BlobFileReaderDecodingErrorTest, DecodingError) {
|
||||
0);
|
||||
options.enable_blob_files = true;
|
||||
|
||||
ImmutableCFOptions immutable_cf_options(options);
|
||||
ImmutableOptions immutable_cf_options(options);
|
||||
|
||||
constexpr uint32_t column_family_id = 1;
|
||||
constexpr bool has_ttl = false;
|
||||
|
@ -1417,7 +1417,8 @@ Status ColumnFamilyData::AddDirectories(
|
||||
|
||||
if (existing_dir == created_dirs->end()) {
|
||||
std::unique_ptr<FSDirectory> path_directory;
|
||||
s = DBImpl::CreateAndNewDirectory(ioptions_.fs, p.path, &path_directory);
|
||||
s = DBImpl::CreateAndNewDirectory(ioptions_.fs.get(), p.path,
|
||||
&path_directory);
|
||||
if (!s.ok()) {
|
||||
return s;
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ class ColumnFamilyData {
|
||||
FlushReason GetFlushReason() const { return flush_reason_; }
|
||||
// thread-safe
|
||||
const FileOptions* soptions() const;
|
||||
const ImmutableCFOptions* ioptions() const { return &ioptions_; }
|
||||
const ImmutableOptions* ioptions() const { return &ioptions_; }
|
||||
// REQUIRES: DB mutex held
|
||||
// This returns the MutableCFOptions used by current SuperVersion
|
||||
// You should use this API to reference MutableCFOptions most of the time.
|
||||
@ -552,7 +552,7 @@ class ColumnFamilyData {
|
||||
int_tbl_prop_collector_factories_;
|
||||
|
||||
const ColumnFamilyOptions initial_cf_options_;
|
||||
const ImmutableCFOptions ioptions_;
|
||||
const ImmutableOptions ioptions_;
|
||||
MutableCFOptions mutable_cf_options_;
|
||||
|
||||
const bool is_delete_range_supported_;
|
||||
|
@ -204,19 +204,16 @@ bool Compaction::IsFullCompaction(
|
||||
return num_files_in_compaction == total_num_files;
|
||||
}
|
||||
|
||||
Compaction::Compaction(VersionStorageInfo* vstorage,
|
||||
const ImmutableCFOptions& _immutable_cf_options,
|
||||
Compaction::Compaction(
|
||||
VersionStorageInfo* vstorage, const ImmutableOptions& _immutable_options,
|
||||
const MutableCFOptions& _mutable_cf_options,
|
||||
const MutableDBOptions& _mutable_db_options,
|
||||
std::vector<CompactionInputFiles> _inputs,
|
||||
int _output_level, uint64_t _target_file_size,
|
||||
uint64_t _max_compaction_bytes, uint32_t _output_path_id,
|
||||
CompressionType _compression,
|
||||
CompressionOptions _compression_opts,
|
||||
uint32_t _max_subcompactions,
|
||||
std::vector<FileMetaData*> _grandparents,
|
||||
bool _manual_compaction, double _score,
|
||||
bool _deletion_compaction,
|
||||
std::vector<CompactionInputFiles> _inputs, int _output_level,
|
||||
uint64_t _target_file_size, uint64_t _max_compaction_bytes,
|
||||
uint32_t _output_path_id, CompressionType _compression,
|
||||
CompressionOptions _compression_opts, uint32_t _max_subcompactions,
|
||||
std::vector<FileMetaData*> _grandparents, bool _manual_compaction,
|
||||
double _score, bool _deletion_compaction,
|
||||
CompactionReason _compaction_reason)
|
||||
: input_vstorage_(vstorage),
|
||||
start_level_(_inputs[0].level),
|
||||
@ -224,7 +221,7 @@ Compaction::Compaction(VersionStorageInfo* vstorage,
|
||||
max_output_file_size_(_target_file_size),
|
||||
max_compaction_bytes_(_max_compaction_bytes),
|
||||
max_subcompactions_(_max_subcompactions),
|
||||
immutable_cf_options_(_immutable_cf_options),
|
||||
immutable_options_(_immutable_options),
|
||||
mutable_cf_options_(_mutable_cf_options),
|
||||
input_version_(nullptr),
|
||||
number_levels_(vstorage->num_levels()),
|
||||
@ -278,7 +275,7 @@ Compaction::~Compaction() {
|
||||
|
||||
bool Compaction::InputCompressionMatchesOutput() const {
|
||||
int base_level = input_vstorage_->base_level();
|
||||
bool matches = (GetCompressionType(immutable_cf_options_, input_vstorage_,
|
||||
bool matches = (GetCompressionType(immutable_options_, input_vstorage_,
|
||||
mutable_cf_options_, start_level_,
|
||||
base_level) == output_compression_);
|
||||
if (matches) {
|
||||
@ -303,8 +300,8 @@ bool Compaction::IsTrivialMove() const {
|
||||
}
|
||||
|
||||
if (is_manual_compaction_ &&
|
||||
(immutable_cf_options_.compaction_filter != nullptr ||
|
||||
immutable_cf_options_.compaction_filter_factory != nullptr)) {
|
||||
(immutable_options_.compaction_filter != nullptr ||
|
||||
immutable_options_.compaction_filter_factory != nullptr)) {
|
||||
// This is a manual compaction and we have a compaction filter that should
|
||||
// be executed, we cannot do a trivial move
|
||||
return false;
|
||||
@ -512,7 +509,7 @@ uint64_t Compaction::OutputFilePreallocationSize() const {
|
||||
}
|
||||
|
||||
if (max_output_file_size_ != port::kMaxUint64 &&
|
||||
(immutable_cf_options_.compaction_style == kCompactionStyleLevel ||
|
||||
(immutable_options_.compaction_style == kCompactionStyleLevel ||
|
||||
output_level() > 0)) {
|
||||
preallocation_size = std::min(max_output_file_size_, preallocation_size);
|
||||
}
|
||||
@ -538,7 +535,7 @@ std::unique_ptr<CompactionFilter> Compaction::CreateCompactionFilter() const {
|
||||
}
|
||||
|
||||
std::unique_ptr<SstPartitioner> Compaction::CreateSstPartitioner() const {
|
||||
if (!immutable_cf_options_.sst_partitioner_factory) {
|
||||
if (!immutable_options_.sst_partitioner_factory) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -548,8 +545,7 @@ std::unique_ptr<SstPartitioner> Compaction::CreateSstPartitioner() const {
|
||||
context.output_level = output_level_;
|
||||
context.smallest_user_key = smallest_user_key_;
|
||||
context.largest_user_key = largest_user_key_;
|
||||
return immutable_cf_options_.sst_partitioner_factory->CreatePartitioner(
|
||||
context);
|
||||
return immutable_options_.sst_partitioner_factory->CreatePartitioner(context);
|
||||
}
|
||||
|
||||
bool Compaction::IsOutputLevelEmpty() const {
|
||||
|
@ -70,7 +70,7 @@ class CompactionFilter;
|
||||
class Compaction {
|
||||
public:
|
||||
Compaction(VersionStorageInfo* input_version,
|
||||
const ImmutableCFOptions& immutable_cf_options,
|
||||
const ImmutableOptions& immutable_options,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
const MutableDBOptions& mutable_db_options,
|
||||
std::vector<CompactionInputFiles> inputs, int output_level,
|
||||
@ -225,8 +225,8 @@ class Compaction {
|
||||
|
||||
// Return the ImmutableCFOptions that should be used throughout the compaction
|
||||
// procedure
|
||||
const ImmutableCFOptions* immutable_cf_options() const {
|
||||
return &immutable_cf_options_;
|
||||
const ImmutableOptions* immutable_cf_options() const {
|
||||
return &immutable_options_;
|
||||
}
|
||||
|
||||
// Return the MutableCFOptions that should be used throughout the compaction
|
||||
@ -330,7 +330,7 @@ class Compaction {
|
||||
uint64_t max_output_file_size_;
|
||||
uint64_t max_compaction_bytes_;
|
||||
uint32_t max_subcompactions_;
|
||||
const ImmutableCFOptions immutable_cf_options_;
|
||||
const ImmutableOptions immutable_options_;
|
||||
const MutableCFOptions mutable_cf_options_;
|
||||
Version* input_version_;
|
||||
VersionEdit edit_;
|
||||
|
@ -969,8 +969,7 @@ void CompactionJob::ProcessKeyValueCompaction(SubcompactionState* sub_compact) {
|
||||
compaction_filter, db_options_.info_log.get(),
|
||||
false /* internal key corruption is expected */,
|
||||
existing_snapshots_.empty() ? 0 : existing_snapshots_.back(),
|
||||
snapshot_checker_, compact_->compaction->level(),
|
||||
db_options_.statistics.get());
|
||||
snapshot_checker_, compact_->compaction->level(), db_options_.stats);
|
||||
|
||||
const MutableCFOptions* mutable_cf_options =
|
||||
sub_compact->compaction->mutable_cf_options();
|
||||
@ -1758,7 +1757,7 @@ Status CompactionJob::OpenCompactionOutputFile(
|
||||
sub_compact->compaction->immutable_cf_options()->listeners;
|
||||
sub_compact->outfile.reset(new WritableFileWriter(
|
||||
std::move(writable_file), fname, file_options_, db_options_.clock,
|
||||
io_tracer_, db_options_.statistics.get(), listeners,
|
||||
io_tracer_, db_options_.stats, listeners,
|
||||
db_options_.file_checksum_gen_factory.get(),
|
||||
tmp_set.Contains(FileType::kTableFile)));
|
||||
|
||||
|
@ -148,7 +148,7 @@ CompressionOptions GetCompressionOptions(const MutableCFOptions& cf_options,
|
||||
return cf_options.compression_opts;
|
||||
}
|
||||
|
||||
CompactionPicker::CompactionPicker(const ImmutableCFOptions& ioptions,
|
||||
CompactionPicker::CompactionPicker(const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator* icmp)
|
||||
: ioptions_(ioptions), icmp_(icmp) {}
|
||||
|
||||
|
@ -46,7 +46,7 @@ struct CompactionInputFiles;
|
||||
// compaction style specific logic for them.
|
||||
class CompactionPicker {
|
||||
public:
|
||||
CompactionPicker(const ImmutableCFOptions& ioptions,
|
||||
CompactionPicker(const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator* icmp);
|
||||
virtual ~CompactionPicker();
|
||||
|
||||
@ -218,7 +218,7 @@ class CompactionPicker {
|
||||
}
|
||||
|
||||
protected:
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
|
||||
// A helper function to SanitizeCompactionInputFiles() that
|
||||
// sanitizes "input_files" by adding necessary files.
|
||||
@ -244,7 +244,7 @@ class CompactionPicker {
|
||||
// compaction.
|
||||
class NullCompactionPicker : public CompactionPicker {
|
||||
public:
|
||||
NullCompactionPicker(const ImmutableCFOptions& ioptions,
|
||||
NullCompactionPicker(const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator* icmp)
|
||||
: CompactionPicker(ioptions, icmp) {}
|
||||
virtual ~NullCompactionPicker() {}
|
||||
|
@ -15,7 +15,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
class FIFOCompactionPicker : public CompactionPicker {
|
||||
public:
|
||||
FIFOCompactionPicker(const ImmutableCFOptions& ioptions,
|
||||
FIFOCompactionPicker(const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator* icmp)
|
||||
: CompactionPicker(ioptions, icmp) {}
|
||||
|
||||
|
@ -49,7 +49,7 @@ class LevelCompactionBuilder {
|
||||
CompactionPicker* compaction_picker,
|
||||
LogBuffer* log_buffer,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const MutableDBOptions& mutable_db_options)
|
||||
: cf_name_(cf_name),
|
||||
vstorage_(vstorage),
|
||||
@ -121,7 +121,7 @@ class LevelCompactionBuilder {
|
||||
CompactionReason compaction_reason_ = CompactionReason::kUnknown;
|
||||
|
||||
const MutableCFOptions& mutable_cf_options_;
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
const MutableDBOptions& mutable_db_options_;
|
||||
// Pick a path ID to place a newly generated file, with its level
|
||||
static uint32_t GetPathId(const ImmutableCFOptions& ioptions,
|
||||
|
@ -17,7 +17,7 @@ namespace ROCKSDB_NAMESPACE {
|
||||
// for description of Leveled compaction.
|
||||
class LevelCompactionPicker : public CompactionPicker {
|
||||
public:
|
||||
LevelCompactionPicker(const ImmutableCFOptions& ioptions,
|
||||
LevelCompactionPicker(const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator* icmp)
|
||||
: CompactionPicker(ioptions, icmp) {}
|
||||
virtual Compaction* PickCompaction(
|
||||
|
@ -30,7 +30,7 @@ class CompactionPickerTest : public testing::Test {
|
||||
const Comparator* ucmp_;
|
||||
InternalKeyComparator icmp_;
|
||||
Options options_;
|
||||
ImmutableCFOptions ioptions_;
|
||||
ImmutableOptions ioptions_;
|
||||
MutableCFOptions mutable_cf_options_;
|
||||
MutableDBOptions mutable_db_options_;
|
||||
LevelCompactionPicker level_compaction_picker;
|
||||
|
@ -32,7 +32,7 @@ namespace {
|
||||
class UniversalCompactionBuilder {
|
||||
public:
|
||||
UniversalCompactionBuilder(
|
||||
const ImmutableCFOptions& ioptions, const InternalKeyComparator* icmp,
|
||||
const ImmutableOptions& ioptions, const InternalKeyComparator* icmp,
|
||||
const std::string& cf_name, const MutableCFOptions& mutable_cf_options,
|
||||
const MutableDBOptions& mutable_db_options, VersionStorageInfo* vstorage,
|
||||
UniversalCompactionPicker* picker, LogBuffer* log_buffer)
|
||||
@ -108,7 +108,7 @@ class UniversalCompactionBuilder {
|
||||
// overlapping.
|
||||
bool IsInputFilesNonOverlapping(Compaction* c);
|
||||
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
const InternalKeyComparator* icmp_;
|
||||
double score_;
|
||||
std::vector<SortedRun> sorted_runs_;
|
||||
|
@ -15,7 +15,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
class UniversalCompactionPicker : public CompactionPicker {
|
||||
public:
|
||||
UniversalCompactionPicker(const ImmutableCFOptions& ioptions,
|
||||
UniversalCompactionPicker(const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator* icmp)
|
||||
: CompactionPicker(ioptions, icmp) {}
|
||||
virtual Compaction* PickCompaction(
|
||||
|
@ -44,7 +44,7 @@ Status VerifySstFileChecksum(const Options& options,
|
||||
std::unique_ptr<FSRandomAccessFile> file;
|
||||
uint64_t file_size;
|
||||
InternalKeyComparator internal_comparator(options.comparator);
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
|
||||
Status s = ioptions.fs->NewRandomAccessFile(file_path,
|
||||
FileOptions(env_options),
|
||||
|
@ -551,7 +551,7 @@ TEST_F(CorruptionTest, RangeDeletionCorrupted) {
|
||||
BlockHandle range_del_handle;
|
||||
ASSERT_OK(FindMetaBlock(
|
||||
file_reader.get(), file_size, kBlockBasedTableMagicNumber,
|
||||
ImmutableCFOptions(options_), kRangeDelBlock, &range_del_handle));
|
||||
ImmutableOptions(options_), kRangeDelBlock, &range_del_handle));
|
||||
|
||||
ASSERT_OK(TryReopen());
|
||||
ASSERT_OK(test::CorruptFile(env_, filename,
|
||||
|
@ -156,7 +156,7 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname,
|
||||
immutable_db_options_(initial_db_options_),
|
||||
fs_(immutable_db_options_.fs, io_tracer_),
|
||||
mutable_db_options_(initial_db_options_),
|
||||
stats_(immutable_db_options_.statistics.get()),
|
||||
stats_(immutable_db_options_.stats),
|
||||
mutex_(stats_, immutable_db_options_.clock, DB_MUTEX_WAIT_MICROS,
|
||||
immutable_db_options_.use_adaptive_mutex),
|
||||
default_cf_handle_(nullptr),
|
||||
@ -706,7 +706,7 @@ const Status DBImpl::CreateArchivalDirectory() {
|
||||
}
|
||||
|
||||
void DBImpl::PrintStatistics() {
|
||||
auto dbstats = immutable_db_options_.statistics.get();
|
||||
auto dbstats = immutable_db_options_.stats;
|
||||
if (dbstats) {
|
||||
ROCKS_LOG_INFO(immutable_db_options_.info_log, "STATISTICS:\n %s",
|
||||
dbstats->ToString().c_str());
|
||||
@ -767,7 +767,7 @@ void DBImpl::PersistStats() {
|
||||
uint64_t now_seconds =
|
||||
immutable_db_options_.clock->NowMicros() / kMicrosInSecond;
|
||||
|
||||
Statistics* statistics = immutable_db_options_.statistics.get();
|
||||
Statistics* statistics = immutable_db_options_.stats;
|
||||
if (!statistics) {
|
||||
return;
|
||||
}
|
||||
@ -3277,7 +3277,7 @@ bool DBImpl::GetIntPropertyInternal(ColumnFamilyData* cfd,
|
||||
|
||||
bool DBImpl::GetPropertyHandleOptionsStatistics(std::string* value) {
|
||||
assert(value != nullptr);
|
||||
Statistics* statistics = immutable_db_options_.statistics.get();
|
||||
Statistics* statistics = immutable_db_options_.stats;
|
||||
if (!statistics) {
|
||||
return false;
|
||||
}
|
||||
|
@ -160,8 +160,8 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options,
|
||||
RecordTick(stats_, WRITE_WITH_WAL);
|
||||
}
|
||||
|
||||
StopWatch write_sw(immutable_db_options_.clock,
|
||||
immutable_db_options_.statistics.get(), DB_WRITE);
|
||||
StopWatch write_sw(immutable_db_options_.clock, immutable_db_options_.stats,
|
||||
DB_WRITE);
|
||||
|
||||
write_thread_.JoinBatchGroup(&w);
|
||||
if (w.state == WriteThread::STATE_PARALLEL_MEMTABLE_WRITER) {
|
||||
@ -466,8 +466,8 @@ Status DBImpl::PipelinedWriteImpl(const WriteOptions& write_options,
|
||||
uint64_t* log_used, uint64_t log_ref,
|
||||
bool disable_memtable, uint64_t* seq_used) {
|
||||
PERF_TIMER_GUARD(write_pre_and_post_process_time);
|
||||
StopWatch write_sw(immutable_db_options_.clock,
|
||||
immutable_db_options_.statistics.get(), DB_WRITE);
|
||||
StopWatch write_sw(immutable_db_options_.clock, immutable_db_options_.stats,
|
||||
DB_WRITE);
|
||||
|
||||
WriteContext write_context;
|
||||
|
||||
@ -623,8 +623,8 @@ Status DBImpl::UnorderedWriteMemtable(const WriteOptions& write_options,
|
||||
SequenceNumber seq,
|
||||
const size_t sub_batch_cnt) {
|
||||
PERF_TIMER_GUARD(write_pre_and_post_process_time);
|
||||
StopWatch write_sw(immutable_db_options_.clock,
|
||||
immutable_db_options_.statistics.get(), DB_WRITE);
|
||||
StopWatch write_sw(immutable_db_options_.clock, immutable_db_options_.stats,
|
||||
DB_WRITE);
|
||||
|
||||
WriteThread::Writer w(write_options, my_batch, callback, log_ref,
|
||||
false /*disable_memtable*/);
|
||||
@ -679,8 +679,8 @@ Status DBImpl::WriteImplWALOnly(
|
||||
WriteThread::Writer w(write_options, my_batch, callback, log_ref,
|
||||
disable_memtable, sub_batch_cnt, pre_release_callback);
|
||||
RecordTick(stats_, WRITE_WITH_WAL);
|
||||
StopWatch write_sw(immutable_db_options_.clock,
|
||||
immutable_db_options_.statistics.get(), DB_WRITE);
|
||||
StopWatch write_sw(immutable_db_options_.clock, immutable_db_options_.stats,
|
||||
DB_WRITE);
|
||||
|
||||
write_thread->JoinBatchGroup(&w);
|
||||
assert(w.state != WriteThread::STATE_PARALLEL_MEMTABLE_WRITER);
|
||||
|
@ -36,7 +36,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
DBIter::DBIter(Env* _env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
const Comparator* cmp, InternalIterator* iter,
|
||||
const Version* version, SequenceNumber s, bool arena_mode,
|
||||
@ -1536,7 +1536,7 @@ void DBIter::SeekToLast() {
|
||||
}
|
||||
|
||||
Iterator* NewDBIterator(Env* env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
const Comparator* user_key_comparator,
|
||||
InternalIterator* internal_iter, const Version* version,
|
||||
|
@ -114,7 +114,7 @@ class DBIter final : public Iterator {
|
||||
};
|
||||
|
||||
DBIter(Env* _env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options, const Comparator* cmp,
|
||||
InternalIterator* iter, const Version* version, SequenceNumber s,
|
||||
bool arena_mode, uint64_t max_sequential_skip_in_iterations,
|
||||
@ -384,7 +384,7 @@ class DBIter final : public Iterator {
|
||||
// into appropriate user keys.
|
||||
extern Iterator* NewDBIterator(
|
||||
Env* env, const ReadOptions& read_options,
|
||||
const ImmutableCFOptions& cf_options,
|
||||
const ImmutableOptions& cf_options,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
const Comparator* user_key_comparator, InternalIterator* internal_iter,
|
||||
const Version* version, const SequenceNumber& sequence,
|
||||
|
@ -511,7 +511,7 @@ TEST_F(DBIteratorStressTest, StressTest) {
|
||||
target_hidden_fraction;
|
||||
internal_iter->trace = trace;
|
||||
db_iter.reset(NewDBIterator(
|
||||
env_, ropt, ImmutableCFOptions(options),
|
||||
env_, ropt, ImmutableOptions(options),
|
||||
MutableCFOptions(options), BytewiseComparator(),
|
||||
internal_iter, nullptr /* version */, sequence,
|
||||
options.max_sequential_skip_in_iterations,
|
||||
|
@ -237,7 +237,7 @@ class DBIteratorTest : public testing::Test {
|
||||
|
||||
TEST_F(DBIteratorTest, DBIteratorPrevNext) {
|
||||
Options options;
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
{
|
||||
TestIterator* internal_iter = new TestIterator(BytewiseComparator());
|
||||
@ -677,7 +677,7 @@ TEST_F(DBIteratorTest, DBIteratorPrevNext) {
|
||||
|
||||
TEST_F(DBIteratorTest, DBIteratorEmpty) {
|
||||
Options options;
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
ReadOptions ro;
|
||||
|
||||
@ -725,7 +725,7 @@ TEST_F(DBIteratorTest, DBIteratorUseSkipCountSkips) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
2 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -757,7 +757,7 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
|
||||
ReadOptions ro;
|
||||
Options options;
|
||||
options.merge_operator = MergeOperators::CreateFromStringId("stringappend");
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
|
||||
{
|
||||
@ -1004,7 +1004,7 @@ TEST_F(DBIteratorTest, DBIteratorUseSkip) {
|
||||
|
||||
TEST_F(DBIteratorTest, DBIteratorSkipInternalKeys) {
|
||||
Options options;
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
ReadOptions ro;
|
||||
|
||||
@ -1399,7 +1399,7 @@ TEST_F(DBIteratorTest, DBIterator1) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
1 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -1428,7 +1428,7 @@ TEST_F(DBIteratorTest, DBIterator2) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
0 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -1454,7 +1454,7 @@ TEST_F(DBIteratorTest, DBIterator3) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
2 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -1480,7 +1480,7 @@ TEST_F(DBIteratorTest, DBIterator4) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
4 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -1500,7 +1500,7 @@ TEST_F(DBIteratorTest, DBIterator5) {
|
||||
ReadOptions ro;
|
||||
Options options;
|
||||
options.merge_operator = MergeOperators::CreateFromStringId("stringappend");
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
|
||||
{
|
||||
@ -1698,7 +1698,7 @@ TEST_F(DBIteratorTest, DBIterator6) {
|
||||
ReadOptions ro;
|
||||
Options options;
|
||||
options.merge_operator = MergeOperators::CreateFromStringId("stringappend");
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
|
||||
{
|
||||
@ -1870,7 +1870,7 @@ TEST_F(DBIteratorTest, DBIterator7) {
|
||||
ReadOptions ro;
|
||||
Options options;
|
||||
options.merge_operator = MergeOperators::CreateFromStringId("stringappend");
|
||||
ImmutableCFOptions cf_options = ImmutableCFOptions(options);
|
||||
ImmutableOptions cf_options = ImmutableOptions(options);
|
||||
MutableCFOptions mutable_cf_options = MutableCFOptions(options);
|
||||
|
||||
{
|
||||
@ -2283,7 +2283,7 @@ TEST_F(DBIteratorTest, DBIterator8) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -2315,7 +2315,7 @@ TEST_F(DBIteratorTest, DBIterator9) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -2383,7 +2383,7 @@ TEST_F(DBIteratorTest, DBIterator10) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -2424,7 +2424,7 @@ TEST_F(DBIteratorTest, SeekToLastOccurrenceSeq0) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, 0 /* force seek */, nullptr /* read_callback */));
|
||||
db_iter->SeekToFirst();
|
||||
@ -2453,7 +2453,7 @@ TEST_F(DBIteratorTest, DBIterator11) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
1 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -2481,7 +2481,7 @@ TEST_F(DBIteratorTest, DBIterator12) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, 0 /* force seek */, nullptr /* read_callback */));
|
||||
db_iter->SeekToLast();
|
||||
@ -2519,7 +2519,7 @@ TEST_F(DBIteratorTest, DBIterator13) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
2 /* sequence */, 3 /* max_sequential_skip_in_iterations */,
|
||||
nullptr /* read_callback */));
|
||||
@ -2549,7 +2549,7 @@ TEST_F(DBIteratorTest, DBIterator14) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
4 /* sequence */, 1 /* max_sequential_skip_in_iterations */,
|
||||
nullptr /* read_callback */));
|
||||
@ -2578,7 +2578,7 @@ TEST_F(DBIteratorTest, DBIteratorTestDifferentialSnapshots) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
13 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -2614,7 +2614,7 @@ TEST_F(DBIteratorTest, DBIteratorTestDifferentialSnapshots) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
13 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -2665,7 +2665,7 @@ class DBIterWithMergeIterTest : public testing::Test {
|
||||
NewMergingIterator(&icomp_, &child_iters[0], 2u);
|
||||
|
||||
db_iter_.reset(NewDBIterator(
|
||||
env_, ro_, ImmutableCFOptions(options_), MutableCFOptions(options_),
|
||||
env_, ro_, ImmutableOptions(options_), MutableCFOptions(options_),
|
||||
BytewiseComparator(), merge_iter, nullptr /* version */,
|
||||
8 /* read data earlier than seqId 8 */,
|
||||
3 /* max iterators before reseek */, nullptr /* read_callback */));
|
||||
@ -3105,7 +3105,7 @@ TEST_F(DBIteratorTest, SeekPrefixTombstones) {
|
||||
|
||||
ro.prefix_same_as_start = true;
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -3142,7 +3142,7 @@ TEST_F(DBIteratorTest, SeekToFirstLowerBound) {
|
||||
ro.iterate_lower_bound = &lower_bound;
|
||||
Options options;
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -3182,7 +3182,7 @@ TEST_F(DBIteratorTest, PrevLowerBound) {
|
||||
ro.iterate_lower_bound = &lower_bound;
|
||||
Options options;
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -3211,7 +3211,7 @@ TEST_F(DBIteratorTest, SeekLessLowerBound) {
|
||||
ro.iterate_lower_bound = &lower_bound;
|
||||
Options options;
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ro, ImmutableCFOptions(options), MutableCFOptions(options),
|
||||
env_, ro, ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
@ -3237,10 +3237,10 @@ TEST_F(DBIteratorTest, ReverseToForwardWithDisappearingKeys) {
|
||||
internal_iter->Finish();
|
||||
|
||||
std::unique_ptr<Iterator> db_iter(NewDBIterator(
|
||||
env_, ReadOptions(), ImmutableCFOptions(options),
|
||||
MutableCFOptions(options), BytewiseComparator(), internal_iter,
|
||||
nullptr /* version */, 10 /* sequence */,
|
||||
options.max_sequential_skip_in_iterations, nullptr /* read_callback */));
|
||||
env_, ReadOptions(), ImmutableOptions(options), MutableCFOptions(options),
|
||||
BytewiseComparator(), internal_iter, nullptr /* version */,
|
||||
10 /* sequence */, options.max_sequential_skip_in_iterations,
|
||||
nullptr /* read_callback */));
|
||||
|
||||
db_iter->SeekForPrev("a");
|
||||
ASSERT_TRUE(db_iter->Valid());
|
||||
|
@ -139,7 +139,7 @@ TEST_F(DBMemTableTest, DuplicateSeq) {
|
||||
InternalKeyComparator cmp(BytewiseComparator());
|
||||
auto factory = std::make_shared<SkipListFactory>();
|
||||
options.memtable_factory = factory;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
MemTable* mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
@ -184,7 +184,7 @@ TEST_F(DBMemTableTest, DuplicateSeq) {
|
||||
// Test with InsertWithHint
|
||||
options.memtable_insert_with_hint_prefix_extractor.reset(
|
||||
new TestPrefixExtractor()); // which uses _ to extract the prefix
|
||||
ioptions = ImmutableCFOptions(options);
|
||||
ioptions = ImmutableOptions(options);
|
||||
mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
// Insert a duplicate key with _ in it
|
||||
@ -197,7 +197,7 @@ TEST_F(DBMemTableTest, DuplicateSeq) {
|
||||
|
||||
// Test when InsertConcurrently will be invoked
|
||||
options.allow_concurrent_memtable_write = true;
|
||||
ioptions = ImmutableCFOptions(options);
|
||||
ioptions = ImmutableOptions(options);
|
||||
mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
MemTablePostProcessInfo post_process_info;
|
||||
@ -224,7 +224,7 @@ TEST_F(DBMemTableTest, ConcurrentMergeWrite) {
|
||||
auto factory = std::make_shared<SkipListFactory>();
|
||||
options.memtable_factory = factory;
|
||||
options.allow_concurrent_memtable_write = true;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
MemTable* mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
|
@ -23,7 +23,7 @@ struct SuperVersion;
|
||||
struct SuperVersionContext {
|
||||
struct WriteStallNotification {
|
||||
WriteStallInfo write_stall_info;
|
||||
const ImmutableCFOptions* immutable_cf_options;
|
||||
const ImmutableOptions* immutable_cf_options;
|
||||
};
|
||||
|
||||
autovector<SuperVersion*> superversions_to_free;
|
||||
@ -57,9 +57,10 @@ struct SuperVersionContext {
|
||||
#endif
|
||||
}
|
||||
|
||||
void PushWriteStallNotification(
|
||||
WriteStallCondition old_cond, WriteStallCondition new_cond,
|
||||
const std::string& name, const ImmutableCFOptions* ioptions) {
|
||||
void PushWriteStallNotification(WriteStallCondition old_cond,
|
||||
WriteStallCondition new_cond,
|
||||
const std::string& name,
|
||||
const ImmutableOptions* ioptions) {
|
||||
#if !defined(ROCKSDB_LITE) && !defined(ROCKSDB_DISABLE_STALL_NOTIFICATION)
|
||||
WriteStallNotification notif;
|
||||
notif.write_stall_info.cf_name = name;
|
||||
|
@ -43,7 +43,7 @@
|
||||
namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
ImmutableMemTableOptions::ImmutableMemTableOptions(
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options)
|
||||
: arena_block_size(mutable_cf_options.arena_block_size),
|
||||
memtable_prefix_bloom_bits(
|
||||
@ -64,7 +64,7 @@ ImmutableMemTableOptions::ImmutableMemTableOptions(
|
||||
allow_data_in_errors(ioptions.allow_data_in_errors) {}
|
||||
|
||||
MemTable::MemTable(const InternalKeyComparator& cmp,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
WriteBufferManager* write_buffer_manager,
|
||||
SequenceNumber latest_seq, uint32_t column_family_id)
|
||||
|
@ -40,7 +40,7 @@ class MergeContext;
|
||||
class SystemClock;
|
||||
|
||||
struct ImmutableMemTableOptions {
|
||||
explicit ImmutableMemTableOptions(const ImmutableCFOptions& ioptions,
|
||||
explicit ImmutableMemTableOptions(const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options);
|
||||
size_t arena_block_size;
|
||||
uint32_t memtable_prefix_bloom_bits;
|
||||
@ -103,7 +103,7 @@ class MemTable {
|
||||
// used, but this may prevent some transactions from succeeding until the
|
||||
// first key is inserted into the memtable.
|
||||
explicit MemTable(const InternalKeyComparator& comparator,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
WriteBufferManager* write_buffer_manager,
|
||||
SequenceNumber earliest_seq, uint32_t column_family_id);
|
||||
|
@ -235,7 +235,7 @@ TEST_F(MemTableListTest, GetTest) {
|
||||
InternalKeyComparator cmp(BytewiseComparator());
|
||||
auto factory = std::make_shared<SkipListFactory>();
|
||||
options.memtable_factory = factory;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
MemTable* mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
@ -358,7 +358,7 @@ TEST_F(MemTableListTest, GetFromHistoryTest) {
|
||||
InternalKeyComparator cmp(BytewiseComparator());
|
||||
auto factory = std::make_shared<SkipListFactory>();
|
||||
options.memtable_factory = factory;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
MemTable* mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
@ -539,7 +539,7 @@ TEST_F(MemTableListTest, FlushPendingTest) {
|
||||
|
||||
auto factory = std::make_shared<SkipListFactory>();
|
||||
options.memtable_factory = factory;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
InternalKeyComparator cmp(BytewiseComparator());
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
autovector<MemTable*> to_delete;
|
||||
@ -808,7 +808,7 @@ TEST_F(MemTableListTest, AtomicFlusTest) {
|
||||
|
||||
auto factory = std::make_shared<SkipListFactory>();
|
||||
options.memtable_factory = factory;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
InternalKeyComparator cmp(BytewiseComparator());
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
|
||||
|
@ -262,18 +262,15 @@ extern const uint64_t kPlainTableMagicNumber;
|
||||
|
||||
class TestPlainTableReader : public PlainTableReader {
|
||||
public:
|
||||
TestPlainTableReader(const EnvOptions& env_options,
|
||||
const InternalKeyComparator& icomparator,
|
||||
EncodingType encoding_type, uint64_t file_size,
|
||||
int bloom_bits_per_key, double hash_table_ratio,
|
||||
size_t index_sparseness,
|
||||
TestPlainTableReader(
|
||||
const EnvOptions& env_options, const InternalKeyComparator& icomparator,
|
||||
EncodingType encoding_type, uint64_t file_size, int bloom_bits_per_key,
|
||||
double hash_table_ratio, size_t index_sparseness,
|
||||
const TableProperties* table_properties,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const SliceTransform* prefix_extractor,
|
||||
const ImmutableOptions& ioptions, const SliceTransform* prefix_extractor,
|
||||
bool* expect_bloom_not_match, bool store_index_in_file,
|
||||
uint32_t column_family_id,
|
||||
const std::string& column_family_name)
|
||||
uint32_t column_family_id, const std::string& column_family_name)
|
||||
: PlainTableReader(ioptions, std::move(file), env_options, icomparator,
|
||||
encoding_type, file_size, table_properties,
|
||||
prefix_extractor),
|
||||
|
@ -100,8 +100,8 @@ class Repairer {
|
||||
icmp_(default_cf_opts.comparator),
|
||||
default_cf_opts_(
|
||||
SanitizeOptions(immutable_db_options_, default_cf_opts)),
|
||||
default_cf_iopts_(
|
||||
ImmutableCFOptions(immutable_db_options_, default_cf_opts_)),
|
||||
default_iopts_(
|
||||
ImmutableOptions(immutable_db_options_, default_cf_opts_)),
|
||||
unknown_cf_opts_(
|
||||
SanitizeOptions(immutable_db_options_, unknown_cf_opts)),
|
||||
create_unknown_cfs_(create_unknown_cfs),
|
||||
@ -110,7 +110,7 @@ class Repairer {
|
||||
// once.
|
||||
NewLRUCache(10, db_options_.table_cache_numshardbits)),
|
||||
table_cache_(new TableCache(
|
||||
default_cf_iopts_, env_options_, raw_table_cache_.get(),
|
||||
default_iopts_, env_options_, raw_table_cache_.get(),
|
||||
/*block_cache_tracer=*/nullptr, /*io_tracer=*/nullptr)),
|
||||
wb_(db_options_.db_write_buffer_size),
|
||||
wc_(db_options_.delayed_write_rate),
|
||||
@ -248,7 +248,7 @@ class Repairer {
|
||||
const ImmutableDBOptions immutable_db_options_;
|
||||
const InternalKeyComparator icmp_;
|
||||
const ColumnFamilyOptions default_cf_opts_;
|
||||
const ImmutableCFOptions default_cf_iopts_; // table_cache_ holds reference
|
||||
const ImmutableOptions default_iopts_; // table_cache_ holds reference
|
||||
const ColumnFamilyOptions unknown_cf_opts_;
|
||||
const bool create_unknown_cfs_;
|
||||
std::shared_ptr<Cache> raw_table_cache_;
|
||||
|
@ -65,7 +65,7 @@ void AppendVarint64(IterKey* key, uint64_t v) {
|
||||
|
||||
const int kLoadConcurency = 128;
|
||||
|
||||
TableCache::TableCache(const ImmutableCFOptions& ioptions,
|
||||
TableCache::TableCache(const ImmutableOptions& ioptions,
|
||||
const FileOptions& file_options, Cache* const cache,
|
||||
BlockCacheTracer* const block_cache_tracer,
|
||||
const std::shared_ptr<IOTracer>& io_tracer)
|
||||
|
@ -48,7 +48,7 @@ class HistogramImpl;
|
||||
// ioptions.row_cache
|
||||
class TableCache {
|
||||
public:
|
||||
TableCache(const ImmutableCFOptions& ioptions,
|
||||
TableCache(const ImmutableOptions& ioptions,
|
||||
const FileOptions& storage_options, Cache* cache,
|
||||
BlockCacheTracer* const block_cache_tracer,
|
||||
const std::shared_ptr<IOTracer>& io_tracer);
|
||||
@ -220,7 +220,7 @@ class TableCache {
|
||||
bool GetFromRowCache(const Slice& user_key, IterKey& row_cache_key,
|
||||
size_t prefix_size, GetContext* get_context);
|
||||
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
const FileOptions& file_options_;
|
||||
Cache* const cache_;
|
||||
std::string row_cache_id_;
|
||||
|
@ -41,7 +41,7 @@ namespace {
|
||||
static const uint32_t kTestColumnFamilyId = 66;
|
||||
static const std::string kTestColumnFamilyName = "test_column_fam";
|
||||
|
||||
void MakeBuilder(const Options& options, const ImmutableCFOptions& ioptions,
|
||||
void MakeBuilder(const Options& options, const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& moptions,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
|
||||
@ -262,7 +262,7 @@ void TestCustomizedTablePropertiesCollector(
|
||||
// -- Step 1: build table
|
||||
std::unique_ptr<TableBuilder> builder;
|
||||
std::unique_ptr<WritableFileWriter> writer;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
int_tbl_prop_collector_factories;
|
||||
@ -409,11 +409,11 @@ void TestInternalKeyPropertiesCollector(
|
||||
options.info_log = std::make_shared<test::NullLogger>();
|
||||
options = SanitizeOptions("db", // just a place holder
|
||||
options);
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
GetIntTblPropCollectorFactory(ioptions, &int_tbl_prop_collector_factories);
|
||||
options.comparator = comparator;
|
||||
}
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
|
||||
for (int iter = 0; iter < 2; ++iter) {
|
||||
|
@ -22,7 +22,7 @@ class VersionBuilderTest : public testing::Test {
|
||||
const Comparator* ucmp_;
|
||||
InternalKeyComparator icmp_;
|
||||
Options options_;
|
||||
ImmutableCFOptions ioptions_;
|
||||
ImmutableOptions ioptions_;
|
||||
MutableCFOptions mutable_cf_options_;
|
||||
VersionStorageInfo vstorage_;
|
||||
uint32_t file_num_;
|
||||
|
@ -2526,7 +2526,7 @@ void VersionStorageInfo::EstimateCompactionBytesNeeded(
|
||||
}
|
||||
|
||||
namespace {
|
||||
uint32_t GetExpiredTtlFilesCount(const ImmutableCFOptions& ioptions,
|
||||
uint32_t GetExpiredTtlFilesCount(const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options,
|
||||
const std::vector<FileMetaData*>& files) {
|
||||
uint32_t ttl_expired_files_count = 0;
|
||||
@ -2550,7 +2550,7 @@ uint32_t GetExpiredTtlFilesCount(const ImmutableCFOptions& ioptions,
|
||||
} // anonymous namespace
|
||||
|
||||
void VersionStorageInfo::ComputeCompactionScore(
|
||||
const ImmutableCFOptions& immutable_cf_options,
|
||||
const ImmutableOptions& immutable_cf_options,
|
||||
const MutableCFOptions& mutable_cf_options) {
|
||||
for (int level = 0; level <= MaxInputLevel(); level++) {
|
||||
double score;
|
||||
@ -2695,7 +2695,7 @@ void VersionStorageInfo::ComputeFilesMarkedForCompaction() {
|
||||
}
|
||||
|
||||
void VersionStorageInfo::ComputeExpiredTtlFiles(
|
||||
const ImmutableCFOptions& ioptions, const uint64_t ttl) {
|
||||
const ImmutableOptions& ioptions, const uint64_t ttl) {
|
||||
assert(ttl > 0);
|
||||
|
||||
expired_ttl_files_.clear();
|
||||
@ -2721,7 +2721,7 @@ void VersionStorageInfo::ComputeExpiredTtlFiles(
|
||||
}
|
||||
|
||||
void VersionStorageInfo::ComputeFilesMarkedForPeriodicCompaction(
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const uint64_t periodic_compaction_seconds) {
|
||||
assert(periodic_compaction_seconds > 0);
|
||||
|
||||
@ -3395,7 +3395,7 @@ uint64_t VersionStorageInfo::MaxBytesForLevel(int level) const {
|
||||
return level_max_bytes_[level];
|
||||
}
|
||||
|
||||
void VersionStorageInfo::CalculateBaseBytes(const ImmutableCFOptions& ioptions,
|
||||
void VersionStorageInfo::CalculateBaseBytes(const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& options) {
|
||||
// Special logic to set number of sorted runs.
|
||||
// It is to match the previous behavior when all files are in L0.
|
||||
|
@ -150,7 +150,7 @@ class VersionStorageInfo {
|
||||
// We use compaction scores to figure out which compaction to do next
|
||||
// REQUIRES: db_mutex held!!
|
||||
// TODO find a better way to pass compaction_options_fifo.
|
||||
void ComputeCompactionScore(const ImmutableCFOptions& immutable_cf_options,
|
||||
void ComputeCompactionScore(const ImmutableOptions& immutable_cf_options,
|
||||
const MutableCFOptions& mutable_cf_options);
|
||||
|
||||
// Estimate est_comp_needed_bytes_
|
||||
@ -163,13 +163,13 @@ class VersionStorageInfo {
|
||||
|
||||
// This computes ttl_expired_files_ and is called by
|
||||
// ComputeCompactionScore()
|
||||
void ComputeExpiredTtlFiles(const ImmutableCFOptions& ioptions,
|
||||
void ComputeExpiredTtlFiles(const ImmutableOptions& ioptions,
|
||||
const uint64_t ttl);
|
||||
|
||||
// This computes files_marked_for_periodic_compaction_ and is called by
|
||||
// ComputeCompactionScore()
|
||||
void ComputeFilesMarkedForPeriodicCompaction(
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const uint64_t periodic_compaction_seconds);
|
||||
|
||||
// This computes bottommost_files_marked_for_compaction_ and is called by
|
||||
@ -482,7 +482,7 @@ class VersionStorageInfo {
|
||||
uint64_t MaxBytesForLevel(int level) const;
|
||||
|
||||
// Must be called after any change to MutableCFOptions.
|
||||
void CalculateBaseBytes(const ImmutableCFOptions& ioptions,
|
||||
void CalculateBaseBytes(const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& options);
|
||||
|
||||
// Returns an estimate of the amount of live data in bytes.
|
||||
|
@ -103,7 +103,7 @@ class VersionStorageInfoTestBase : public testing::Test {
|
||||
InternalKeyComparator icmp_;
|
||||
std::shared_ptr<CountingLogger> logger_;
|
||||
Options options_;
|
||||
ImmutableCFOptions ioptions_;
|
||||
ImmutableOptions ioptions_;
|
||||
MutableCFOptions mutable_cf_options_;
|
||||
VersionStorageInfo vstorage_;
|
||||
|
||||
@ -723,7 +723,8 @@ class VersionSetTestBase {
|
||||
db_options_.env = env_;
|
||||
db_options_.fs = fs_;
|
||||
immutable_cf_options_.env = env_;
|
||||
immutable_cf_options_.fs = fs_.get();
|
||||
immutable_cf_options_.fs = fs_;
|
||||
immutable_cf_options_.clock = env_->GetSystemClock().get();
|
||||
|
||||
versions_.reset(
|
||||
new VersionSet(dbname_, &db_options_, env_options_, table_cache_.get(),
|
||||
@ -909,7 +910,7 @@ class VersionSetTestBase {
|
||||
Options options_;
|
||||
ImmutableDBOptions db_options_;
|
||||
ColumnFamilyOptions cf_options_;
|
||||
ImmutableCFOptions immutable_cf_options_;
|
||||
ImmutableOptions immutable_cf_options_;
|
||||
MutableCFOptions mutable_cf_options_;
|
||||
std::shared_ptr<Cache> table_cache_;
|
||||
WriteController write_controller_;
|
||||
|
@ -33,7 +33,7 @@ static std::string PrintContents(WriteBatch* b,
|
||||
if (merge_operator_supported) {
|
||||
options.merge_operator.reset(new TestPutOperator());
|
||||
}
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
WriteBufferManager wb(options.db_write_buffer_size);
|
||||
MemTable* mem = new MemTable(cmp, ioptions, MutableCFOptions(options), &wb,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
|
@ -424,8 +424,7 @@ Status SetIdentityFile(Env* env, const std::string& dbname,
|
||||
IOStatus SyncManifest(const ImmutableDBOptions* db_options,
|
||||
WritableFileWriter* file) {
|
||||
TEST_KILL_RANDOM("SyncManifest:0", rocksdb_kill_odds * REDUCE_ODDS2);
|
||||
StopWatch sw(db_options->clock, db_options->statistics.get(),
|
||||
MANIFEST_FILE_SYNC_MICROS);
|
||||
StopWatch sw(db_options->clock, db_options->stats, MANIFEST_FILE_SYNC_MICROS);
|
||||
return file->Sync(db_options->use_fsync);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ jbyteArray Java_org_rocksdb_WriteBatchTest_getContents(JNIEnv* env,
|
||||
ROCKSDB_NAMESPACE::WriteBufferManager wb(options.db_write_buffer_size);
|
||||
options.memtable_factory = factory;
|
||||
ROCKSDB_NAMESPACE::MemTable* mem = new ROCKSDB_NAMESPACE::MemTable(
|
||||
cmp, ROCKSDB_NAMESPACE::ImmutableCFOptions(options),
|
||||
cmp, ROCKSDB_NAMESPACE::ImmutableOptions(options),
|
||||
ROCKSDB_NAMESPACE::MutableCFOptions(options), &wb,
|
||||
ROCKSDB_NAMESPACE::kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
mem->Ref();
|
||||
|
@ -701,7 +701,7 @@ class ConfigurableCFOptions : public ConfigurableMutableCFOptions {
|
||||
ConfigurableCFOptions(const ColumnFamilyOptions& opts,
|
||||
const std::unordered_map<std::string, std::string>* map)
|
||||
: ConfigurableMutableCFOptions(MutableCFOptions(opts)),
|
||||
immutable_(ImmutableDBOptions(), opts),
|
||||
immutable_(opts),
|
||||
cf_options_(opts),
|
||||
opt_map_(map) {
|
||||
RegisterOptions(&immutable_, &cf_immutable_options_type_info);
|
||||
@ -714,7 +714,8 @@ class ConfigurableCFOptions : public ConfigurableMutableCFOptions {
|
||||
std::unordered_map<std::string, std::string>* unused) override {
|
||||
Status s = Configurable::ConfigureOptions(config_options, opts_map, unused);
|
||||
if (s.ok()) {
|
||||
cf_options_ = BuildColumnFamilyOptions(immutable_, mutable_);
|
||||
UpdateColumnFamilyOptions(mutable_, &cf_options_);
|
||||
UpdateColumnFamilyOptions(immutable_, &cf_options_);
|
||||
s = PrepareOptions(config_options);
|
||||
}
|
||||
return s;
|
||||
@ -788,11 +789,7 @@ std::unique_ptr<Configurable> CFOptionsAsConfigurable(
|
||||
|
||||
ImmutableCFOptions::ImmutableCFOptions() : ImmutableCFOptions(Options()) {}
|
||||
|
||||
ImmutableCFOptions::ImmutableCFOptions(const Options& options)
|
||||
: ImmutableCFOptions(ImmutableDBOptions(options), options) {}
|
||||
|
||||
ImmutableCFOptions::ImmutableCFOptions(const ImmutableDBOptions& db_options,
|
||||
const ColumnFamilyOptions& cf_options)
|
||||
ImmutableCFOptions::ImmutableCFOptions(const ColumnFamilyOptions& cf_options)
|
||||
: compaction_style(cf_options.compaction_style),
|
||||
compaction_pri(cf_options.compaction_pri),
|
||||
user_comparator(cf_options.comparator),
|
||||
@ -808,48 +805,45 @@ ImmutableCFOptions::ImmutableCFOptions(const ImmutableDBOptions& db_options,
|
||||
cf_options.max_write_buffer_size_to_maintain),
|
||||
inplace_update_support(cf_options.inplace_update_support),
|
||||
inplace_callback(cf_options.inplace_callback),
|
||||
logger(db_options.logger),
|
||||
stats(db_options.stats),
|
||||
rate_limiter(db_options.rate_limiter),
|
||||
info_log_level(db_options.info_log_level),
|
||||
env(db_options.env),
|
||||
fs(db_options.fs.get()),
|
||||
clock(db_options.clock),
|
||||
allow_mmap_reads(db_options.allow_mmap_reads),
|
||||
allow_mmap_writes(db_options.allow_mmap_writes),
|
||||
db_paths(db_options.db_paths),
|
||||
memtable_factory(cf_options.memtable_factory),
|
||||
table_factory(cf_options.table_factory),
|
||||
table_properties_collector_factories(
|
||||
cf_options.table_properties_collector_factories),
|
||||
advise_random_on_open(db_options.advise_random_on_open),
|
||||
bloom_locality(cf_options.bloom_locality),
|
||||
purge_redundant_kvs_while_flush(
|
||||
cf_options.purge_redundant_kvs_while_flush),
|
||||
use_fsync(db_options.use_fsync),
|
||||
compression_per_level(cf_options.compression_per_level),
|
||||
level_compaction_dynamic_level_bytes(
|
||||
cf_options.level_compaction_dynamic_level_bytes),
|
||||
access_hint_on_compaction_start(
|
||||
db_options.access_hint_on_compaction_start),
|
||||
new_table_reader_for_compaction_inputs(
|
||||
db_options.new_table_reader_for_compaction_inputs),
|
||||
num_levels(cf_options.num_levels),
|
||||
optimize_filters_for_hits(cf_options.optimize_filters_for_hits),
|
||||
force_consistency_checks(cf_options.force_consistency_checks),
|
||||
allow_ingest_behind(db_options.allow_ingest_behind),
|
||||
preserve_deletes(db_options.preserve_deletes),
|
||||
listeners(db_options.listeners),
|
||||
row_cache(db_options.row_cache),
|
||||
memtable_insert_with_hint_prefix_extractor(
|
||||
cf_options.memtable_insert_with_hint_prefix_extractor),
|
||||
cf_paths(cf_options.cf_paths),
|
||||
compaction_thread_limiter(cf_options.compaction_thread_limiter),
|
||||
file_checksum_gen_factory(db_options.file_checksum_gen_factory),
|
||||
sst_partitioner_factory(cf_options.sst_partitioner_factory),
|
||||
allow_data_in_errors(db_options.allow_data_in_errors),
|
||||
db_host_id(db_options.db_host_id),
|
||||
checksum_handoff_file_types(db_options.checksum_handoff_file_types) {}
|
||||
sst_partitioner_factory(cf_options.sst_partitioner_factory) {}
|
||||
|
||||
ImmutableOptions::ImmutableOptions() : ImmutableOptions(Options()) {}
|
||||
|
||||
ImmutableOptions::ImmutableOptions(const Options& options)
|
||||
: ImmutableOptions(options, options) {}
|
||||
|
||||
ImmutableOptions::ImmutableOptions(const DBOptions& db_options,
|
||||
const ColumnFamilyOptions& cf_options)
|
||||
: ImmutableDBOptions(db_options), ImmutableCFOptions(cf_options) {}
|
||||
|
||||
ImmutableOptions::ImmutableOptions(const DBOptions& db_options,
|
||||
const ImmutableCFOptions& cf_options)
|
||||
: ImmutableDBOptions(db_options), ImmutableCFOptions(cf_options) {}
|
||||
|
||||
ImmutableOptions::ImmutableOptions(const ImmutableDBOptions& db_options,
|
||||
const ColumnFamilyOptions& cf_options)
|
||||
: ImmutableDBOptions(db_options), ImmutableCFOptions(cf_options) {}
|
||||
|
||||
ImmutableOptions::ImmutableOptions(const ImmutableDBOptions& db_options,
|
||||
const ImmutableCFOptions& cf_options)
|
||||
: ImmutableDBOptions(db_options), ImmutableCFOptions(cf_options) {}
|
||||
|
||||
// Multiple two operands. If they overflow, return op1.
|
||||
uint64_t MultiplyCheckOverflow(uint64_t op1, double op2) {
|
||||
|
@ -23,10 +23,7 @@ struct ImmutableCFOptions {
|
||||
public:
|
||||
static const char* kName() { return "ImmutableCFOptions"; }
|
||||
explicit ImmutableCFOptions();
|
||||
explicit ImmutableCFOptions(const Options& options);
|
||||
|
||||
ImmutableCFOptions(const ImmutableDBOptions& db_options,
|
||||
const ColumnFamilyOptions& cf_options);
|
||||
explicit ImmutableCFOptions(const ColumnFamilyOptions& cf_options);
|
||||
|
||||
CompactionStyle compaction_style;
|
||||
|
||||
@ -54,28 +51,6 @@ struct ImmutableCFOptions {
|
||||
Slice delta_value,
|
||||
std::string* merged_value);
|
||||
|
||||
Logger* logger; // ImmutableDBOptions
|
||||
|
||||
Statistics* stats; // ImmutableDBOptions
|
||||
|
||||
std::shared_ptr<RateLimiter> rate_limiter; // ImmutableDBOptions
|
||||
|
||||
InfoLogLevel info_log_level; // ImmutableDBOptions
|
||||
|
||||
Env* env; // ImmutableDBOptions
|
||||
|
||||
FileSystem* fs; // ImmutableDBOptions
|
||||
|
||||
SystemClock* clock; // ImmutableDBOptions
|
||||
|
||||
// Allow the OS to mmap file for reading sst tables. Default: false
|
||||
bool allow_mmap_reads; // ImmutableDBOptions
|
||||
|
||||
// Allow the OS to mmap file for writing. Default: false
|
||||
bool allow_mmap_writes; // ImmutableDBOptions
|
||||
|
||||
std::vector<DbPath> db_paths; // ImmutableDBOptions
|
||||
|
||||
std::shared_ptr<MemTableRepFactory> memtable_factory;
|
||||
|
||||
std::shared_ptr<TableFactory> table_factory;
|
||||
@ -83,40 +58,22 @@ struct ImmutableCFOptions {
|
||||
Options::TablePropertiesCollectorFactories
|
||||
table_properties_collector_factories;
|
||||
|
||||
bool advise_random_on_open; // ImmutableDBOptions
|
||||
|
||||
// This options is required by PlainTableReader. May need to move it
|
||||
// to PlainTableOptions just like bloom_bits_per_key
|
||||
uint32_t bloom_locality;
|
||||
|
||||
bool purge_redundant_kvs_while_flush;
|
||||
|
||||
bool use_fsync; // ImmutableDBOptions
|
||||
|
||||
std::vector<CompressionType> compression_per_level;
|
||||
|
||||
bool level_compaction_dynamic_level_bytes;
|
||||
|
||||
Options::AccessHint access_hint_on_compaction_start; // ImmutableDBOptions
|
||||
|
||||
bool new_table_reader_for_compaction_inputs; // ImmutableDBOptions
|
||||
|
||||
int num_levels;
|
||||
|
||||
bool optimize_filters_for_hits;
|
||||
|
||||
bool force_consistency_checks;
|
||||
|
||||
bool allow_ingest_behind; // ImmutableDBOptions
|
||||
|
||||
bool preserve_deletes; // ImmutableDBOptions
|
||||
|
||||
// A vector of EventListeners which callback functions will be called
|
||||
// when specific RocksDB event happens.
|
||||
std::vector<std::shared_ptr<EventListener>> listeners; // ImmutableDBOptions
|
||||
|
||||
std::shared_ptr<Cache> row_cache; // ImmutableDBOptions
|
||||
|
||||
std::shared_ptr<const SliceTransform>
|
||||
memtable_insert_with_hint_prefix_extractor;
|
||||
|
||||
@ -124,16 +81,24 @@ struct ImmutableCFOptions {
|
||||
|
||||
std::shared_ptr<ConcurrentTaskLimiter> compaction_thread_limiter;
|
||||
|
||||
std::shared_ptr<FileChecksumGenFactory>
|
||||
file_checksum_gen_factory; // ImmutableDBOptions
|
||||
|
||||
std::shared_ptr<SstPartitionerFactory> sst_partitioner_factory;
|
||||
};
|
||||
|
||||
bool allow_data_in_errors; // ImmutableDBOptions
|
||||
struct ImmutableOptions : public ImmutableDBOptions, public ImmutableCFOptions {
|
||||
explicit ImmutableOptions();
|
||||
explicit ImmutableOptions(const Options& options);
|
||||
|
||||
std::string db_host_id; // ImmutableDBOptions
|
||||
ImmutableOptions(const DBOptions& db_options,
|
||||
const ColumnFamilyOptions& cf_options);
|
||||
|
||||
FileTypeSet checksum_handoff_file_types; // ImmutableDBOptions
|
||||
ImmutableOptions(const ImmutableDBOptions& db_options,
|
||||
const ImmutableCFOptions& cf_options);
|
||||
|
||||
ImmutableOptions(const DBOptions& db_options,
|
||||
const ImmutableCFOptions& cf_options);
|
||||
|
||||
ImmutableOptions(const ImmutableDBOptions& db_options,
|
||||
const ColumnFamilyOptions& cf_options);
|
||||
};
|
||||
|
||||
struct MutableCFOptions {
|
||||
|
@ -580,6 +580,7 @@ ImmutableDBOptions::ImmutableDBOptions(const DBOptions& options)
|
||||
allow_data_in_errors(options.allow_data_in_errors),
|
||||
db_host_id(options.db_host_id),
|
||||
checksum_handoff_file_types(options.checksum_handoff_file_types) {
|
||||
stats = statistics.get();
|
||||
fs = env->GetFileSystem();
|
||||
if (env != nullptr) {
|
||||
clock = env->GetSystemClock().get();
|
||||
@ -610,7 +611,7 @@ void ImmutableDBOptions::Dump(Logger* log) const {
|
||||
ROCKS_LOG_HEADER(log, " Options.max_file_opening_threads: %d",
|
||||
max_file_opening_threads);
|
||||
ROCKS_LOG_HEADER(log, " Options.statistics: %p",
|
||||
statistics.get());
|
||||
stats);
|
||||
ROCKS_LOG_HEADER(log, " Options.use_fsync: %d",
|
||||
use_fsync);
|
||||
ROCKS_LOG_HEADER(
|
||||
|
@ -177,190 +177,115 @@ ColumnFamilyOptions BuildColumnFamilyOptions(
|
||||
const ColumnFamilyOptions& options,
|
||||
const MutableCFOptions& mutable_cf_options) {
|
||||
ColumnFamilyOptions cf_opts(options);
|
||||
|
||||
// Memtable related options
|
||||
cf_opts.write_buffer_size = mutable_cf_options.write_buffer_size;
|
||||
cf_opts.max_write_buffer_number = mutable_cf_options.max_write_buffer_number;
|
||||
cf_opts.arena_block_size = mutable_cf_options.arena_block_size;
|
||||
cf_opts.memtable_prefix_bloom_size_ratio =
|
||||
mutable_cf_options.memtable_prefix_bloom_size_ratio;
|
||||
cf_opts.memtable_whole_key_filtering =
|
||||
mutable_cf_options.memtable_whole_key_filtering;
|
||||
cf_opts.memtable_huge_page_size = mutable_cf_options.memtable_huge_page_size;
|
||||
cf_opts.max_successive_merges = mutable_cf_options.max_successive_merges;
|
||||
cf_opts.inplace_update_num_locks =
|
||||
mutable_cf_options.inplace_update_num_locks;
|
||||
cf_opts.prefix_extractor = mutable_cf_options.prefix_extractor;
|
||||
|
||||
// Compaction related options
|
||||
cf_opts.disable_auto_compactions =
|
||||
mutable_cf_options.disable_auto_compactions;
|
||||
cf_opts.soft_pending_compaction_bytes_limit =
|
||||
mutable_cf_options.soft_pending_compaction_bytes_limit;
|
||||
cf_opts.hard_pending_compaction_bytes_limit =
|
||||
mutable_cf_options.hard_pending_compaction_bytes_limit;
|
||||
cf_opts.level0_file_num_compaction_trigger =
|
||||
mutable_cf_options.level0_file_num_compaction_trigger;
|
||||
cf_opts.level0_slowdown_writes_trigger =
|
||||
mutable_cf_options.level0_slowdown_writes_trigger;
|
||||
cf_opts.level0_stop_writes_trigger =
|
||||
mutable_cf_options.level0_stop_writes_trigger;
|
||||
cf_opts.max_compaction_bytes = mutable_cf_options.max_compaction_bytes;
|
||||
cf_opts.target_file_size_base = mutable_cf_options.target_file_size_base;
|
||||
cf_opts.target_file_size_multiplier =
|
||||
mutable_cf_options.target_file_size_multiplier;
|
||||
cf_opts.max_bytes_for_level_base =
|
||||
mutable_cf_options.max_bytes_for_level_base;
|
||||
cf_opts.max_bytes_for_level_multiplier =
|
||||
mutable_cf_options.max_bytes_for_level_multiplier;
|
||||
cf_opts.ttl = mutable_cf_options.ttl;
|
||||
cf_opts.periodic_compaction_seconds =
|
||||
mutable_cf_options.periodic_compaction_seconds;
|
||||
|
||||
cf_opts.max_bytes_for_level_multiplier_additional.clear();
|
||||
for (auto value :
|
||||
mutable_cf_options.max_bytes_for_level_multiplier_additional) {
|
||||
cf_opts.max_bytes_for_level_multiplier_additional.emplace_back(value);
|
||||
}
|
||||
|
||||
cf_opts.compaction_options_fifo = mutable_cf_options.compaction_options_fifo;
|
||||
cf_opts.compaction_options_universal =
|
||||
mutable_cf_options.compaction_options_universal;
|
||||
|
||||
// Blob file related options
|
||||
cf_opts.enable_blob_files = mutable_cf_options.enable_blob_files;
|
||||
cf_opts.min_blob_size = mutable_cf_options.min_blob_size;
|
||||
cf_opts.blob_file_size = mutable_cf_options.blob_file_size;
|
||||
cf_opts.blob_compression_type = mutable_cf_options.blob_compression_type;
|
||||
cf_opts.enable_blob_garbage_collection =
|
||||
mutable_cf_options.enable_blob_garbage_collection;
|
||||
cf_opts.blob_garbage_collection_age_cutoff =
|
||||
mutable_cf_options.blob_garbage_collection_age_cutoff;
|
||||
|
||||
// Misc options
|
||||
cf_opts.max_sequential_skip_in_iterations =
|
||||
mutable_cf_options.max_sequential_skip_in_iterations;
|
||||
cf_opts.check_flush_compaction_key_order =
|
||||
mutable_cf_options.check_flush_compaction_key_order;
|
||||
cf_opts.paranoid_file_checks = mutable_cf_options.paranoid_file_checks;
|
||||
cf_opts.report_bg_io_stats = mutable_cf_options.report_bg_io_stats;
|
||||
cf_opts.compression = mutable_cf_options.compression;
|
||||
cf_opts.compression_opts = mutable_cf_options.compression_opts;
|
||||
cf_opts.bottommost_compression = mutable_cf_options.bottommost_compression;
|
||||
cf_opts.bottommost_compression_opts =
|
||||
mutable_cf_options.bottommost_compression_opts;
|
||||
cf_opts.sample_for_compression = mutable_cf_options.sample_for_compression;
|
||||
|
||||
cf_opts.table_factory = options.table_factory;
|
||||
UpdateColumnFamilyOptions(mutable_cf_options, &cf_opts);
|
||||
// TODO(yhchiang): find some way to handle the following derived options
|
||||
// * max_file_size
|
||||
|
||||
return cf_opts;
|
||||
}
|
||||
ColumnFamilyOptions BuildColumnFamilyOptions(const ImmutableCFOptions& ioptions,
|
||||
const MutableCFOptions& moptions) {
|
||||
ColumnFamilyOptions cf_opts;
|
||||
|
||||
void UpdateColumnFamilyOptions(const MutableCFOptions& moptions,
|
||||
ColumnFamilyOptions* cf_opts) {
|
||||
// Memtable related options
|
||||
cf_opts.write_buffer_size = moptions.write_buffer_size;
|
||||
cf_opts.max_write_buffer_number = moptions.max_write_buffer_number;
|
||||
cf_opts.arena_block_size = moptions.arena_block_size;
|
||||
cf_opts.memtable_prefix_bloom_size_ratio =
|
||||
cf_opts->write_buffer_size = moptions.write_buffer_size;
|
||||
cf_opts->max_write_buffer_number = moptions.max_write_buffer_number;
|
||||
cf_opts->arena_block_size = moptions.arena_block_size;
|
||||
cf_opts->memtable_prefix_bloom_size_ratio =
|
||||
moptions.memtable_prefix_bloom_size_ratio;
|
||||
cf_opts.memtable_whole_key_filtering = moptions.memtable_whole_key_filtering;
|
||||
cf_opts.memtable_huge_page_size = moptions.memtable_huge_page_size;
|
||||
cf_opts.max_successive_merges = moptions.max_successive_merges;
|
||||
cf_opts.inplace_update_num_locks = moptions.inplace_update_num_locks;
|
||||
cf_opts.prefix_extractor = moptions.prefix_extractor;
|
||||
cf_opts->memtable_whole_key_filtering = moptions.memtable_whole_key_filtering;
|
||||
cf_opts->memtable_huge_page_size = moptions.memtable_huge_page_size;
|
||||
cf_opts->max_successive_merges = moptions.max_successive_merges;
|
||||
cf_opts->inplace_update_num_locks = moptions.inplace_update_num_locks;
|
||||
cf_opts->prefix_extractor = moptions.prefix_extractor;
|
||||
|
||||
// Compaction related options
|
||||
cf_opts.disable_auto_compactions = moptions.disable_auto_compactions;
|
||||
cf_opts.soft_pending_compaction_bytes_limit =
|
||||
cf_opts->disable_auto_compactions = moptions.disable_auto_compactions;
|
||||
cf_opts->soft_pending_compaction_bytes_limit =
|
||||
moptions.soft_pending_compaction_bytes_limit;
|
||||
cf_opts.hard_pending_compaction_bytes_limit =
|
||||
cf_opts->hard_pending_compaction_bytes_limit =
|
||||
moptions.hard_pending_compaction_bytes_limit;
|
||||
cf_opts.level0_file_num_compaction_trigger =
|
||||
cf_opts->level0_file_num_compaction_trigger =
|
||||
moptions.level0_file_num_compaction_trigger;
|
||||
cf_opts.level0_slowdown_writes_trigger =
|
||||
cf_opts->level0_slowdown_writes_trigger =
|
||||
moptions.level0_slowdown_writes_trigger;
|
||||
cf_opts.level0_stop_writes_trigger = moptions.level0_stop_writes_trigger;
|
||||
cf_opts.max_compaction_bytes = moptions.max_compaction_bytes;
|
||||
cf_opts.target_file_size_base = moptions.target_file_size_base;
|
||||
cf_opts.target_file_size_multiplier = moptions.target_file_size_multiplier;
|
||||
cf_opts.max_bytes_for_level_base = moptions.max_bytes_for_level_base;
|
||||
cf_opts.max_bytes_for_level_multiplier =
|
||||
cf_opts->level0_stop_writes_trigger = moptions.level0_stop_writes_trigger;
|
||||
cf_opts->max_compaction_bytes = moptions.max_compaction_bytes;
|
||||
cf_opts->target_file_size_base = moptions.target_file_size_base;
|
||||
cf_opts->target_file_size_multiplier = moptions.target_file_size_multiplier;
|
||||
cf_opts->max_bytes_for_level_base = moptions.max_bytes_for_level_base;
|
||||
cf_opts->max_bytes_for_level_multiplier =
|
||||
moptions.max_bytes_for_level_multiplier;
|
||||
cf_opts.ttl = moptions.ttl;
|
||||
cf_opts.periodic_compaction_seconds = moptions.periodic_compaction_seconds;
|
||||
cf_opts->ttl = moptions.ttl;
|
||||
cf_opts->periodic_compaction_seconds = moptions.periodic_compaction_seconds;
|
||||
|
||||
cf_opts.max_bytes_for_level_multiplier_additional.clear();
|
||||
cf_opts->max_bytes_for_level_multiplier_additional.clear();
|
||||
for (auto value : moptions.max_bytes_for_level_multiplier_additional) {
|
||||
cf_opts.max_bytes_for_level_multiplier_additional.emplace_back(value);
|
||||
cf_opts->max_bytes_for_level_multiplier_additional.emplace_back(value);
|
||||
}
|
||||
|
||||
cf_opts.compaction_options_fifo = moptions.compaction_options_fifo;
|
||||
cf_opts.compaction_options_universal = moptions.compaction_options_universal;
|
||||
cf_opts->compaction_options_fifo = moptions.compaction_options_fifo;
|
||||
cf_opts->compaction_options_universal = moptions.compaction_options_universal;
|
||||
|
||||
// Blob file related options
|
||||
cf_opts.enable_blob_files = moptions.enable_blob_files;
|
||||
cf_opts.min_blob_size = moptions.min_blob_size;
|
||||
cf_opts.blob_file_size = moptions.blob_file_size;
|
||||
cf_opts.blob_compression_type = moptions.blob_compression_type;
|
||||
cf_opts.enable_blob_garbage_collection =
|
||||
cf_opts->enable_blob_files = moptions.enable_blob_files;
|
||||
cf_opts->min_blob_size = moptions.min_blob_size;
|
||||
cf_opts->blob_file_size = moptions.blob_file_size;
|
||||
cf_opts->blob_compression_type = moptions.blob_compression_type;
|
||||
cf_opts->enable_blob_garbage_collection =
|
||||
moptions.enable_blob_garbage_collection;
|
||||
cf_opts.blob_garbage_collection_age_cutoff =
|
||||
cf_opts->blob_garbage_collection_age_cutoff =
|
||||
moptions.blob_garbage_collection_age_cutoff;
|
||||
|
||||
// Misc options
|
||||
cf_opts.max_sequential_skip_in_iterations =
|
||||
cf_opts->max_sequential_skip_in_iterations =
|
||||
moptions.max_sequential_skip_in_iterations;
|
||||
cf_opts.check_flush_compaction_key_order =
|
||||
cf_opts->check_flush_compaction_key_order =
|
||||
moptions.check_flush_compaction_key_order;
|
||||
cf_opts.paranoid_file_checks = moptions.paranoid_file_checks;
|
||||
cf_opts.report_bg_io_stats = moptions.report_bg_io_stats;
|
||||
cf_opts.compression = moptions.compression;
|
||||
cf_opts.compression_opts = moptions.compression_opts;
|
||||
cf_opts.bottommost_compression = moptions.bottommost_compression;
|
||||
cf_opts.bottommost_compression_opts = moptions.bottommost_compression_opts;
|
||||
cf_opts.sample_for_compression = moptions.sample_for_compression;
|
||||
cf_opts->paranoid_file_checks = moptions.paranoid_file_checks;
|
||||
cf_opts->report_bg_io_stats = moptions.report_bg_io_stats;
|
||||
cf_opts->compression = moptions.compression;
|
||||
cf_opts->compression_opts = moptions.compression_opts;
|
||||
cf_opts->bottommost_compression = moptions.bottommost_compression;
|
||||
cf_opts->bottommost_compression_opts = moptions.bottommost_compression_opts;
|
||||
cf_opts->sample_for_compression = moptions.sample_for_compression;
|
||||
}
|
||||
|
||||
cf_opts.compaction_style = ioptions.compaction_style;
|
||||
cf_opts.compaction_pri = ioptions.compaction_pri;
|
||||
cf_opts.comparator = ioptions.user_comparator;
|
||||
cf_opts.merge_operator = ioptions.merge_operator;
|
||||
cf_opts.compaction_filter = ioptions.compaction_filter;
|
||||
cf_opts.compaction_filter_factory = ioptions.compaction_filter_factory;
|
||||
cf_opts.min_write_buffer_number_to_merge =
|
||||
void UpdateColumnFamilyOptions(const ImmutableCFOptions& ioptions,
|
||||
ColumnFamilyOptions* cf_opts) {
|
||||
cf_opts->compaction_style = ioptions.compaction_style;
|
||||
cf_opts->compaction_pri = ioptions.compaction_pri;
|
||||
cf_opts->comparator = ioptions.user_comparator;
|
||||
cf_opts->merge_operator = ioptions.merge_operator;
|
||||
cf_opts->compaction_filter = ioptions.compaction_filter;
|
||||
cf_opts->compaction_filter_factory = ioptions.compaction_filter_factory;
|
||||
cf_opts->min_write_buffer_number_to_merge =
|
||||
ioptions.min_write_buffer_number_to_merge;
|
||||
cf_opts.max_write_buffer_number_to_maintain =
|
||||
cf_opts->max_write_buffer_number_to_maintain =
|
||||
ioptions.max_write_buffer_number_to_maintain;
|
||||
cf_opts.max_write_buffer_size_to_maintain =
|
||||
cf_opts->max_write_buffer_size_to_maintain =
|
||||
ioptions.max_write_buffer_size_to_maintain;
|
||||
cf_opts.inplace_update_support = ioptions.inplace_update_support;
|
||||
cf_opts.inplace_callback = ioptions.inplace_callback;
|
||||
cf_opts.memtable_factory = ioptions.memtable_factory;
|
||||
cf_opts.table_factory = ioptions.table_factory;
|
||||
cf_opts.table_properties_collector_factories =
|
||||
cf_opts->inplace_update_support = ioptions.inplace_update_support;
|
||||
cf_opts->inplace_callback = ioptions.inplace_callback;
|
||||
cf_opts->memtable_factory = ioptions.memtable_factory;
|
||||
cf_opts->table_factory = ioptions.table_factory;
|
||||
cf_opts->table_properties_collector_factories =
|
||||
ioptions.table_properties_collector_factories;
|
||||
cf_opts.bloom_locality = ioptions.bloom_locality;
|
||||
cf_opts.purge_redundant_kvs_while_flush =
|
||||
cf_opts->bloom_locality = ioptions.bloom_locality;
|
||||
cf_opts->purge_redundant_kvs_while_flush =
|
||||
ioptions.purge_redundant_kvs_while_flush;
|
||||
cf_opts.compression_per_level = ioptions.compression_per_level;
|
||||
cf_opts.level_compaction_dynamic_level_bytes =
|
||||
cf_opts->compression_per_level = ioptions.compression_per_level;
|
||||
cf_opts->level_compaction_dynamic_level_bytes =
|
||||
ioptions.level_compaction_dynamic_level_bytes;
|
||||
cf_opts.num_levels = ioptions.num_levels;
|
||||
cf_opts.optimize_filters_for_hits = ioptions.optimize_filters_for_hits;
|
||||
cf_opts.force_consistency_checks = ioptions.force_consistency_checks;
|
||||
cf_opts.memtable_insert_with_hint_prefix_extractor =
|
||||
cf_opts->num_levels = ioptions.num_levels;
|
||||
cf_opts->optimize_filters_for_hits = ioptions.optimize_filters_for_hits;
|
||||
cf_opts->force_consistency_checks = ioptions.force_consistency_checks;
|
||||
cf_opts->memtable_insert_with_hint_prefix_extractor =
|
||||
ioptions.memtable_insert_with_hint_prefix_extractor;
|
||||
cf_opts.cf_paths = ioptions.cf_paths;
|
||||
cf_opts.compaction_thread_limiter = ioptions.compaction_thread_limiter;
|
||||
cf_opts.sst_partitioner_factory = ioptions.sst_partitioner_factory;
|
||||
cf_opts->cf_paths = ioptions.cf_paths;
|
||||
cf_opts->compaction_thread_limiter = ioptions.compaction_thread_limiter;
|
||||
cf_opts->sst_partitioner_factory = ioptions.sst_partitioner_factory;
|
||||
|
||||
// TODO(yhchiang): find some way to handle the following derived options
|
||||
// * max_file_size
|
||||
|
||||
return cf_opts;
|
||||
}
|
||||
|
||||
std::map<CompactionStyle, std::string>
|
||||
|
@ -38,8 +38,11 @@ DBOptions BuildDBOptions(const ImmutableDBOptions& immutable_db_options,
|
||||
ColumnFamilyOptions BuildColumnFamilyOptions(
|
||||
const ColumnFamilyOptions& ioptions,
|
||||
const MutableCFOptions& mutable_cf_options);
|
||||
ColumnFamilyOptions BuildColumnFamilyOptions(const ImmutableCFOptions& ioptions,
|
||||
const MutableCFOptions& moptions);
|
||||
|
||||
void UpdateColumnFamilyOptions(const ImmutableCFOptions& ioptions,
|
||||
ColumnFamilyOptions* cf_opts);
|
||||
void UpdateColumnFamilyOptions(const MutableCFOptions& moptions,
|
||||
ColumnFamilyOptions* cf_opts);
|
||||
|
||||
#ifndef ROCKSDB_LITE
|
||||
std::unique_ptr<Configurable> DBOptionsAsConfigurable(
|
||||
|
@ -1321,8 +1321,9 @@ TEST_F(OptionsTest, CFOptionsComposeImmutable) {
|
||||
DBOptions dummy; // Needed to create ImmutableCFOptions
|
||||
test::RandomInitCFOptions(&base_opts, dummy, &rnd);
|
||||
MutableCFOptions m_opts(base_opts);
|
||||
ImmutableCFOptions i_opts(ImmutableDBOptions(dummy), base_opts);
|
||||
new_opts = BuildColumnFamilyOptions(i_opts, m_opts);
|
||||
ImmutableCFOptions i_opts(base_opts);
|
||||
UpdateColumnFamilyOptions(i_opts, &new_opts);
|
||||
UpdateColumnFamilyOptions(m_opts, &new_opts);
|
||||
ASSERT_OK(RocksDBOptionsParser::VerifyCFOptions(config_options, base_opts,
|
||||
new_opts));
|
||||
delete new_opts.compaction_filter;
|
||||
|
@ -247,7 +247,7 @@ class BlockBasedTableBuilder::BlockBasedTablePropertiesCollector
|
||||
};
|
||||
|
||||
struct BlockBasedTableBuilder::Rep {
|
||||
const ImmutableCFOptions ioptions;
|
||||
const ImmutableOptions ioptions;
|
||||
const MutableCFOptions moptions;
|
||||
const BlockBasedTableOptions table_options;
|
||||
const InternalKeyComparator& internal_comparator;
|
||||
|
@ -150,7 +150,7 @@ template <typename TBlocklike>
|
||||
Status ReadBlockFromFile(
|
||||
RandomAccessFileReader* file, FilePrefetchBuffer* prefetch_buffer,
|
||||
const Footer& footer, const ReadOptions& options, const BlockHandle& handle,
|
||||
std::unique_ptr<TBlocklike>* result, const ImmutableCFOptions& ioptions,
|
||||
std::unique_ptr<TBlocklike>* result, const ImmutableOptions& ioptions,
|
||||
bool do_uncompress, bool maybe_compressed, BlockType block_type,
|
||||
const UncompressionDict& uncompression_dict,
|
||||
const PersistentCacheOptions& cache_options, size_t read_amp_bytes_per_bit,
|
||||
@ -568,7 +568,7 @@ Slice BlockBasedTable::GetCacheKey(const char* cache_key_prefix,
|
||||
}
|
||||
|
||||
Status BlockBasedTable::Open(
|
||||
const ReadOptions& read_options, const ImmutableCFOptions& ioptions,
|
||||
const ReadOptions& read_options, const ImmutableOptions& ioptions,
|
||||
const EnvOptions& env_options, const BlockBasedTableOptions& table_options,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
|
||||
@ -1273,7 +1273,7 @@ Status BlockBasedTable::PutDataBlockToCache(
|
||||
const UncompressionDict& uncompression_dict,
|
||||
MemoryAllocator* memory_allocator, BlockType block_type,
|
||||
GetContext* get_context) const {
|
||||
const ImmutableCFOptions& ioptions = rep_->ioptions;
|
||||
const ImmutableOptions& ioptions = rep_->ioptions;
|
||||
const uint32_t format_version = rep_->table_options.format_version;
|
||||
const size_t read_amp_bytes_per_bit =
|
||||
block_type == BlockType::kData
|
||||
@ -1640,7 +1640,7 @@ void BlockBasedTable::RetrieveMultipleBlocks(
|
||||
char* scratch, const UncompressionDict& uncompression_dict) const {
|
||||
RandomAccessFileReader* file = rep_->file.get();
|
||||
const Footer& footer = rep_->footer;
|
||||
const ImmutableCFOptions& ioptions = rep_->ioptions;
|
||||
const ImmutableOptions& ioptions = rep_->ioptions;
|
||||
size_t read_amp_bytes_per_bit = rep_->table_options.read_amp_bytes_per_bit;
|
||||
MemoryAllocator* memory_allocator = GetMemoryAllocator(rep_->table_options);
|
||||
|
||||
|
@ -84,7 +84,7 @@ class BlockBasedTable : public TableReader {
|
||||
// are set.
|
||||
// @param force_direct_prefetch if true, always prefetching to RocksDB
|
||||
// buffer, rather than calling RandomAccessFile::Prefetch().
|
||||
static Status Open(const ReadOptions& ro, const ImmutableCFOptions& ioptions,
|
||||
static Status Open(const ReadOptions& ro, const ImmutableOptions& ioptions,
|
||||
const EnvOptions& env_options,
|
||||
const BlockBasedTableOptions& table_options,
|
||||
const InternalKeyComparator& internal_key_comparator,
|
||||
@ -502,7 +502,7 @@ class BlockBasedTable::PartitionedIndexIteratorState
|
||||
// Stores all the properties associated with a BlockBasedTable.
|
||||
// These are immutable.
|
||||
struct BlockBasedTable::Rep {
|
||||
Rep(const ImmutableCFOptions& _ioptions, const EnvOptions& _env_options,
|
||||
Rep(const ImmutableOptions& _ioptions, const EnvOptions& _env_options,
|
||||
const BlockBasedTableOptions& _table_opt,
|
||||
const InternalKeyComparator& _internal_comparator, bool skip_filters,
|
||||
uint64_t _file_size, int _level, const bool _immortal_table)
|
||||
@ -519,10 +519,9 @@ struct BlockBasedTable::Rep {
|
||||
global_seqno(kDisableGlobalSequenceNumber),
|
||||
file_size(_file_size),
|
||||
level(_level),
|
||||
immortal_table(_immortal_table) {
|
||||
}
|
||||
immortal_table(_immortal_table) {}
|
||||
~Rep() { status.PermitUncheckedError(); }
|
||||
const ImmutableCFOptions& ioptions;
|
||||
const ImmutableOptions& ioptions;
|
||||
const EnvOptions& env_options;
|
||||
const BlockBasedTableOptions table_options;
|
||||
const FilterPolicy* const filter_policy;
|
||||
|
@ -59,7 +59,7 @@ class BlockBasedTableReaderTest
|
||||
|
||||
// Create table builder.
|
||||
Options options;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
InternalKeyComparator comparator(options.comparator);
|
||||
ColumnFamilyOptions cf_options;
|
||||
MutableCFOptions moptions(cf_options);
|
||||
@ -81,7 +81,7 @@ class BlockBasedTableReaderTest
|
||||
}
|
||||
|
||||
void NewBlockBasedTableReader(const FileOptions& foptions,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const InternalKeyComparator& comparator,
|
||||
const std::string& table_name,
|
||||
std::unique_ptr<BlockBasedTable>* table) {
|
||||
@ -197,7 +197,7 @@ TEST_P(BlockBasedTableReaderTest, MultiGet) {
|
||||
|
||||
std::unique_ptr<BlockBasedTable> table;
|
||||
Options options;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
FileOptions foptions;
|
||||
foptions.use_direct_reads = use_direct_reads_;
|
||||
InternalKeyComparator comparator(options.comparator);
|
||||
@ -275,7 +275,7 @@ TEST_P(BlockBasedTableReaderTestVerifyChecksum, ChecksumMismatch) {
|
||||
|
||||
std::unique_ptr<BlockBasedTable> table;
|
||||
Options options;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
FileOptions foptions;
|
||||
foptions.use_direct_reads = use_direct_reads_;
|
||||
InternalKeyComparator comparator(options.comparator);
|
||||
|
@ -539,7 +539,7 @@ void TestBoundary(InternalKey& ik1, std::string& v1, InternalKey& ik2,
|
||||
int level_ = -1;
|
||||
|
||||
std::vector<std::string> keys;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
const InternalKeyComparator internal_comparator(options.comparator);
|
||||
|
||||
|
@ -66,7 +66,7 @@ Status HashIndexReader::Create(const BlockBasedTable* table,
|
||||
|
||||
RandomAccessFileReader* const file = rep->file.get();
|
||||
const Footer& footer = rep->footer;
|
||||
const ImmutableCFOptions& ioptions = rep->ioptions;
|
||||
const ImmutableOptions& ioptions = rep->ioptions;
|
||||
const PersistentCacheOptions& cache_options = rep->persistent_cache_options;
|
||||
MemoryAllocator* const memory_allocator =
|
||||
GetMemoryAllocator(rep->table_options);
|
||||
|
@ -23,7 +23,7 @@ class MockBlockBasedTableTester {
|
||||
|
||||
public:
|
||||
Options options_;
|
||||
ImmutableCFOptions ioptions_;
|
||||
ImmutableOptions ioptions_;
|
||||
EnvOptions env_options_;
|
||||
BlockBasedTableOptions table_options_;
|
||||
InternalKeyComparator icomp_;
|
||||
|
@ -58,7 +58,7 @@ class PartitionedFilterBlockTest
|
||||
virtual public ::testing::WithParamInterface<uint32_t> {
|
||||
public:
|
||||
Options options_;
|
||||
ImmutableCFOptions ioptions_;
|
||||
ImmutableOptions ioptions_;
|
||||
EnvOptions env_options_;
|
||||
BlockBasedTableOptions table_options_;
|
||||
InternalKeyComparator icomp_;
|
||||
|
@ -39,7 +39,7 @@ class BlockFetcher {
|
||||
BlockFetcher(RandomAccessFileReader* file,
|
||||
FilePrefetchBuffer* prefetch_buffer, const Footer& footer,
|
||||
const ReadOptions& read_options, const BlockHandle& handle,
|
||||
BlockContents* contents, const ImmutableCFOptions& ioptions,
|
||||
BlockContents* contents, const ImmutableOptions& ioptions,
|
||||
bool do_uncompress, bool maybe_compressed, BlockType block_type,
|
||||
const UncompressionDict& uncompression_dict,
|
||||
const PersistentCacheOptions& cache_options,
|
||||
@ -90,7 +90,7 @@ class BlockFetcher {
|
||||
const ReadOptions read_options_;
|
||||
const BlockHandle& handle_;
|
||||
BlockContents* contents_;
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
const bool do_uncompress_;
|
||||
const bool maybe_compressed_;
|
||||
const BlockType block_type_;
|
||||
|
@ -93,7 +93,7 @@ class BlockFetcherTest : public testing::Test {
|
||||
NewFileWriter(table_name, &writer);
|
||||
|
||||
// Create table builder.
|
||||
ImmutableCFOptions ioptions(options_);
|
||||
ImmutableOptions ioptions(options_);
|
||||
InternalKeyComparator comparator(options_.comparator);
|
||||
ColumnFamilyOptions cf_options(options_);
|
||||
MutableCFOptions moptions(cf_options);
|
||||
@ -271,7 +271,7 @@ class BlockFetcherTest : public testing::Test {
|
||||
env_->GetSystemClock().get()));
|
||||
}
|
||||
|
||||
void NewTableReader(const ImmutableCFOptions& ioptions,
|
||||
void NewTableReader(const ImmutableOptions& ioptions,
|
||||
const FileOptions& foptions,
|
||||
const InternalKeyComparator& comparator,
|
||||
const std::string& table_name,
|
||||
@ -317,7 +317,7 @@ class BlockFetcherTest : public testing::Test {
|
||||
MemoryAllocator* compressed_buf_allocator,
|
||||
BlockContents* contents, MemcpyStats* stats,
|
||||
CompressionType* compresstion_type) {
|
||||
ImmutableCFOptions ioptions(options_);
|
||||
ImmutableOptions ioptions(options_);
|
||||
ReadOptions roptions;
|
||||
PersistentCacheOptions persistent_cache_options;
|
||||
Footer footer;
|
||||
@ -348,7 +348,7 @@ class BlockFetcherTest : public testing::Test {
|
||||
MemoryAllocator* compressed_buf_allocator,
|
||||
BlockContents* block, std::string* result,
|
||||
MemcpyStats* memcpy_stats) {
|
||||
ImmutableCFOptions ioptions(options_);
|
||||
ImmutableOptions ioptions(options_);
|
||||
InternalKeyComparator comparator(options_.comparator);
|
||||
FileOptions foptions(options_);
|
||||
|
||||
|
@ -64,7 +64,7 @@ class CuckooBuilderTest : public testing::Test {
|
||||
|
||||
Options options;
|
||||
options.allow_mmap_reads = true;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
|
||||
// Assert Table Properties.
|
||||
TableProperties* props = nullptr;
|
||||
|
@ -15,7 +15,9 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "memory/arena.h"
|
||||
#include "options/cf_options.h"
|
||||
#include "rocksdb/iterator.h"
|
||||
#include "rocksdb/table.h"
|
||||
#include "table/cuckoo/cuckoo_table_factory.h"
|
||||
@ -33,7 +35,7 @@ const uint32_t kInvalidIndex = std::numeric_limits<uint32_t>::max();
|
||||
extern const uint64_t kCuckooTableMagicNumber;
|
||||
|
||||
CuckooTableReader::CuckooTableReader(
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
|
||||
const Comparator* comparator,
|
||||
uint64_t (*get_slice_hash)(const Slice&, uint32_t, uint64_t))
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include "db/dbformat.h"
|
||||
#include "file/random_access_file_reader.h"
|
||||
#include "options/cf_options.h"
|
||||
#include "rocksdb/env.h"
|
||||
#include "rocksdb/options.h"
|
||||
#include "table/table_reader.h"
|
||||
@ -25,10 +24,11 @@ namespace ROCKSDB_NAMESPACE {
|
||||
|
||||
class Arena;
|
||||
class TableReader;
|
||||
struct ImmutableOptions;
|
||||
|
||||
class CuckooTableReader: public TableReader {
|
||||
public:
|
||||
CuckooTableReader(const ImmutableCFOptions& ioptions,
|
||||
CuckooTableReader(const ImmutableOptions& ioptions,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file,
|
||||
uint64_t file_size, const Comparator* user_comparator,
|
||||
uint64_t (*get_slice_hash)(const Slice&, uint32_t,
|
||||
|
@ -109,7 +109,7 @@ class CuckooReaderTest : public testing::Test {
|
||||
std::unique_ptr<RandomAccessFileReader> file_reader;
|
||||
ASSERT_OK(RandomAccessFileReader::Create(
|
||||
env->GetFileSystem(), fname, file_options, &file_reader, nullptr));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
CuckooTableReader reader(ioptions, std::move(file_reader), file_size, ucomp,
|
||||
GetSliceHash);
|
||||
ASSERT_OK(reader.status());
|
||||
@ -137,7 +137,7 @@ class CuckooReaderTest : public testing::Test {
|
||||
std::unique_ptr<RandomAccessFileReader> file_reader;
|
||||
ASSERT_OK(RandomAccessFileReader::Create(
|
||||
env->GetFileSystem(), fname, file_options, &file_reader, nullptr));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
CuckooTableReader reader(ioptions, std::move(file_reader), file_size, ucomp,
|
||||
GetSliceHash);
|
||||
ASSERT_OK(reader.status());
|
||||
@ -209,7 +209,7 @@ class CuckooReaderTest : public testing::Test {
|
||||
|
||||
TEST_F(CuckooReaderTest, FileNotMmaped) {
|
||||
options.allow_mmap_reads = false;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
CuckooTableReader reader(ioptions, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_TRUE(reader.status().IsInvalidArgument());
|
||||
ASSERT_STREQ("File is not mmaped", reader.status().getState());
|
||||
@ -328,7 +328,7 @@ TEST_F(CuckooReaderTest, WhenKeyNotFound) {
|
||||
ASSERT_OK(RandomAccessFileReader::Create(
|
||||
env->GetFileSystem(), fname, file_options, &file_reader, nullptr));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
CuckooTableReader reader(ioptions, std::move(file_reader), file_size, ucmp,
|
||||
GetSliceHash);
|
||||
ASSERT_OK(reader.status());
|
||||
@ -437,7 +437,7 @@ void WriteFile(const std::vector<std::string>& keys,
|
||||
ASSERT_OK(RandomAccessFileReader::Create(fs, fname, file_options,
|
||||
&file_reader, nullptr));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
CuckooTableReader reader(ioptions, std::move(file_reader), file_size,
|
||||
test::Uint64Comparator(), nullptr);
|
||||
ASSERT_OK(reader.status());
|
||||
@ -470,7 +470,7 @@ void ReadKeys(uint64_t num, uint32_t batch_size) {
|
||||
ASSERT_OK(RandomAccessFileReader::Create(fs, fname, file_options,
|
||||
&file_reader, nullptr));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
CuckooTableReader reader(ioptions, std::move(file_reader), file_size,
|
||||
test::Uint64Comparator(), nullptr);
|
||||
ASSERT_OK(reader.status());
|
||||
|
@ -347,7 +347,7 @@ Status ReadFooterFromFile(const IOOptions& opts, RandomAccessFileReader* file,
|
||||
Status UncompressBlockContentsForCompressionType(
|
||||
const UncompressionInfo& uncompression_info, const char* data, size_t n,
|
||||
BlockContents* contents, uint32_t format_version,
|
||||
const ImmutableCFOptions& ioptions, MemoryAllocator* allocator) {
|
||||
const ImmutableOptions& ioptions, MemoryAllocator* allocator) {
|
||||
Status ret = Status::OK();
|
||||
|
||||
assert(uncompression_info.type() != kNoCompression &&
|
||||
@ -396,7 +396,7 @@ Status UncompressBlockContentsForCompressionType(
|
||||
Status UncompressBlockContents(const UncompressionInfo& uncompression_info,
|
||||
const char* data, size_t n,
|
||||
BlockContents* contents, uint32_t format_version,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
MemoryAllocator* allocator) {
|
||||
assert(data[n] != kNoCompression);
|
||||
assert(data[n] == static_cast<char>(uncompression_info.type()));
|
||||
|
@ -305,7 +305,7 @@ struct BlockContents {
|
||||
extern Status ReadBlockContents(
|
||||
RandomAccessFileReader* file, FilePrefetchBuffer* prefetch_buffer,
|
||||
const Footer& footer, const ReadOptions& options, const BlockHandle& handle,
|
||||
BlockContents* contents, const ImmutableCFOptions& ioptions,
|
||||
BlockContents* contents, const ImmutableOptions& ioptions,
|
||||
bool do_uncompress = true, const Slice& compression_dict = Slice(),
|
||||
const PersistentCacheOptions& cache_options = PersistentCacheOptions());
|
||||
|
||||
@ -320,7 +320,7 @@ extern Status UncompressBlockContents(const UncompressionInfo& info,
|
||||
const char* data, size_t n,
|
||||
BlockContents* contents,
|
||||
uint32_t compress_format_version,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
MemoryAllocator* allocator = nullptr);
|
||||
|
||||
// This is an extension to UncompressBlockContents that accepts
|
||||
@ -329,7 +329,7 @@ extern Status UncompressBlockContents(const UncompressionInfo& info,
|
||||
extern Status UncompressBlockContentsForCompressionType(
|
||||
const UncompressionInfo& info, const char* data, size_t n,
|
||||
BlockContents* contents, uint32_t compress_format_version,
|
||||
const ImmutableCFOptions& ioptions, MemoryAllocator* allocator = nullptr);
|
||||
const ImmutableOptions& ioptions, MemoryAllocator* allocator = nullptr);
|
||||
|
||||
// Replace db_host_id contents with the real hostname if necessary
|
||||
extern Status ReifyDbHostIdProperty(Env* env, std::string* db_host_id);
|
||||
|
@ -211,7 +211,7 @@ bool NotifyCollectTableCollectorsOnFinish(
|
||||
Status ReadProperties(const ReadOptions& read_options,
|
||||
const Slice& handle_value, RandomAccessFileReader* file,
|
||||
FilePrefetchBuffer* prefetch_buffer, const Footer& footer,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
TableProperties** table_properties, bool verify_checksum,
|
||||
BlockHandle* ret_block_handle,
|
||||
CacheAllocationPtr* verification_buf,
|
||||
@ -383,7 +383,7 @@ Status ReadProperties(const ReadOptions& read_options,
|
||||
|
||||
Status ReadTableProperties(RandomAccessFileReader* file, uint64_t file_size,
|
||||
uint64_t table_magic_number,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
TableProperties** properties,
|
||||
bool compression_type_missing,
|
||||
MemoryAllocator* memory_allocator,
|
||||
@ -454,7 +454,7 @@ Status FindMetaBlock(InternalIterator* meta_index_iter,
|
||||
|
||||
Status FindMetaBlock(RandomAccessFileReader* file, uint64_t file_size,
|
||||
uint64_t table_magic_number,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const std::string& meta_block_name,
|
||||
BlockHandle* block_handle,
|
||||
bool /*compression_type_missing*/,
|
||||
@ -496,7 +496,7 @@ Status FindMetaBlock(RandomAccessFileReader* file, uint64_t file_size,
|
||||
Status ReadMetaBlock(RandomAccessFileReader* file,
|
||||
FilePrefetchBuffer* prefetch_buffer, uint64_t file_size,
|
||||
uint64_t table_magic_number,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const std::string& meta_block_name, BlockType block_type,
|
||||
BlockContents* contents, bool /*compression_type_missing*/,
|
||||
MemoryAllocator* memory_allocator) {
|
||||
|
@ -102,7 +102,7 @@ bool NotifyCollectTableCollectorsOnFinish(
|
||||
Status ReadProperties(const ReadOptions& ro, const Slice& handle_value,
|
||||
RandomAccessFileReader* file,
|
||||
FilePrefetchBuffer* prefetch_buffer, const Footer& footer,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
TableProperties** table_properties, bool verify_checksum,
|
||||
BlockHandle* block_handle,
|
||||
CacheAllocationPtr* verification_buf,
|
||||
@ -119,7 +119,7 @@ Status ReadProperties(const ReadOptions& ro, const Slice& handle_value,
|
||||
// `ReadProperties`, `FindMetaBlock`, and `ReadMetaBlock`
|
||||
Status ReadTableProperties(RandomAccessFileReader* file, uint64_t file_size,
|
||||
uint64_t table_magic_number,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
TableProperties** properties,
|
||||
bool compression_type_missing = false,
|
||||
MemoryAllocator* memory_allocator = nullptr,
|
||||
@ -133,7 +133,7 @@ Status FindMetaBlock(InternalIterator* meta_index_iter,
|
||||
// Find the meta block
|
||||
Status FindMetaBlock(RandomAccessFileReader* file, uint64_t file_size,
|
||||
uint64_t table_magic_number,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const std::string& meta_block_name,
|
||||
BlockHandle* block_handle,
|
||||
bool compression_type_missing = false,
|
||||
@ -145,7 +145,7 @@ Status FindMetaBlock(RandomAccessFileReader* file, uint64_t file_size,
|
||||
Status ReadMetaBlock(RandomAccessFileReader* file,
|
||||
FilePrefetchBuffer* prefetch_buffer, uint64_t file_size,
|
||||
uint64_t table_magic_number,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const std::string& meta_block_name, BlockType block_type,
|
||||
BlockContents* contents,
|
||||
bool compression_type_missing = false,
|
||||
|
@ -57,7 +57,7 @@ extern const uint64_t kPlainTableMagicNumber = 0x8242229663bf9564ull;
|
||||
extern const uint64_t kLegacyPlainTableMagicNumber = 0x4f3418eb7a8f13b8ull;
|
||||
|
||||
PlainTableBuilder::PlainTableBuilder(
|
||||
const ImmutableCFOptions& ioptions, const MutableCFOptions& moptions,
|
||||
const ImmutableOptions& ioptions, const MutableCFOptions& moptions,
|
||||
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
|
||||
int_tbl_prop_collector_factories,
|
||||
uint32_t column_family_id, WritableFileWriter* file, uint32_t user_key_len,
|
||||
|
@ -37,7 +37,7 @@ class PlainTableBuilder: public TableBuilder {
|
||||
// will be part of level specified by 'level'. A value of -1 means
|
||||
// that the caller does not know which level the output file will reside.
|
||||
PlainTableBuilder(
|
||||
const ImmutableCFOptions& ioptions, const MutableCFOptions& moptions,
|
||||
const ImmutableOptions& ioptions, const MutableCFOptions& moptions,
|
||||
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
|
||||
int_tbl_prop_collector_factories,
|
||||
uint32_t column_family_id, WritableFileWriter* file,
|
||||
@ -96,7 +96,7 @@ class PlainTableBuilder: public TableBuilder {
|
||||
|
||||
private:
|
||||
Arena arena_;
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
const MutableCFOptions& moptions_;
|
||||
std::vector<std::unique_ptr<IntTblPropCollector>>
|
||||
table_properties_collectors_;
|
||||
|
@ -131,7 +131,7 @@ class PlainTableIndex {
|
||||
// The class is used by PlainTableBuilder class.
|
||||
class PlainTableIndexBuilder {
|
||||
public:
|
||||
PlainTableIndexBuilder(Arena* arena, const ImmutableCFOptions& ioptions,
|
||||
PlainTableIndexBuilder(Arena* arena, const ImmutableOptions& ioptions,
|
||||
const SliceTransform* prefix_extractor,
|
||||
size_t index_sparseness, double hash_table_ratio,
|
||||
size_t huge_page_tlb_size)
|
||||
@ -222,7 +222,7 @@ class PlainTableIndexBuilder {
|
||||
const std::vector<uint32_t>& entries_per_bucket);
|
||||
|
||||
Arena* arena_;
|
||||
const ImmutableCFOptions ioptions_;
|
||||
const ImmutableOptions ioptions_;
|
||||
HistogramImpl keys_per_prefix_hist_;
|
||||
IndexRecordList record_list_;
|
||||
bool is_first_record_;
|
||||
|
@ -93,7 +93,7 @@ class PlainTableIterator : public InternalIterator {
|
||||
|
||||
extern const uint64_t kPlainTableMagicNumber;
|
||||
PlainTableReader::PlainTableReader(
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file,
|
||||
const EnvOptions& storage_options, const InternalKeyComparator& icomparator,
|
||||
EncodingType encoding_type, uint64_t file_size,
|
||||
@ -118,7 +118,7 @@ PlainTableReader::~PlainTableReader() {
|
||||
}
|
||||
|
||||
Status PlainTableReader::Open(
|
||||
const ImmutableCFOptions& ioptions, const EnvOptions& env_options,
|
||||
const ImmutableOptions& ioptions, const EnvOptions& env_options,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file, uint64_t file_size,
|
||||
std::unique_ptr<TableReader>* table_reader, const int bloom_bits_per_key,
|
||||
|
@ -67,7 +67,7 @@ class PlainTableReader: public TableReader {
|
||||
// whether it points to the data offset of the first key with the key prefix
|
||||
// or the offset of it. If there are too many keys share this prefix, it will
|
||||
// create a binary search-able index from the suffix to offset on disk.
|
||||
static Status Open(const ImmutableCFOptions& ioptions,
|
||||
static Status Open(const ImmutableOptions& ioptions,
|
||||
const EnvOptions& env_options,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file,
|
||||
@ -110,7 +110,7 @@ class PlainTableReader: public TableReader {
|
||||
return arena_.MemoryAllocatedBytes();
|
||||
}
|
||||
|
||||
PlainTableReader(const ImmutableCFOptions& ioptions,
|
||||
PlainTableReader(const ImmutableOptions& ioptions,
|
||||
std::unique_ptr<RandomAccessFileReader>&& file,
|
||||
const EnvOptions& env_options,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
@ -163,7 +163,7 @@ class PlainTableReader: public TableReader {
|
||||
CacheAllocationPtr index_block_alloc_;
|
||||
CacheAllocationPtr bloom_block_alloc_;
|
||||
|
||||
const ImmutableCFOptions& ioptions_;
|
||||
const ImmutableOptions& ioptions_;
|
||||
std::unique_ptr<Cleanable> dummy_cleanable_;
|
||||
uint64_t file_size_;
|
||||
protected: // for testing
|
||||
|
@ -145,7 +145,7 @@ Status SstFileDumper::GetTableReader(const std::string& file_path) {
|
||||
}
|
||||
|
||||
Status SstFileDumper::NewTableReader(
|
||||
const ImmutableCFOptions& /*ioptions*/, const EnvOptions& /*soptions*/,
|
||||
const ImmutableOptions& /*ioptions*/, const EnvOptions& /*soptions*/,
|
||||
const InternalKeyComparator& /*internal_comparator*/, uint64_t file_size,
|
||||
std::unique_ptr<TableReader>* /*table_reader*/) {
|
||||
auto t_opt =
|
||||
@ -264,7 +264,7 @@ Status SstFileDumper::ShowCompressionSize(
|
||||
Options opts;
|
||||
opts.statistics = ROCKSDB_NAMESPACE::CreateDBStatistics();
|
||||
opts.statistics->set_stats_level(StatsLevel::kAll);
|
||||
const ImmutableCFOptions imoptions(opts);
|
||||
const ImmutableOptions imoptions(opts);
|
||||
const ColumnFamilyOptions cfo(opts);
|
||||
const MutableCFOptions moptions(cfo);
|
||||
ROCKSDB_NAMESPACE::InternalKeyComparator ikc(opts.comparator);
|
||||
|
@ -63,7 +63,7 @@ class SstFileDumper {
|
||||
|
||||
// Helper function to call the factory with settings specific to the
|
||||
// factory implementation
|
||||
Status NewTableReader(const ImmutableCFOptions& ioptions,
|
||||
Status NewTableReader(const ImmutableOptions& ioptions,
|
||||
const EnvOptions& soptions,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
uint64_t file_size,
|
||||
@ -85,7 +85,7 @@ class SstFileDumper {
|
||||
std::unique_ptr<TableReader> table_reader_;
|
||||
std::unique_ptr<RandomAccessFileReader> file_;
|
||||
|
||||
const ImmutableCFOptions ioptions_;
|
||||
const ImmutableOptions ioptions_;
|
||||
const MutableCFOptions moptions_;
|
||||
ReadOptions read_options_;
|
||||
InternalKeyComparator internal_comparator_;
|
||||
|
@ -23,7 +23,7 @@ namespace ROCKSDB_NAMESPACE {
|
||||
struct SstFileReader::Rep {
|
||||
Options options;
|
||||
EnvOptions soptions;
|
||||
ImmutableCFOptions ioptions;
|
||||
ImmutableOptions ioptions;
|
||||
MutableCFOptions moptions;
|
||||
|
||||
std::unique_ptr<TableReader> table_reader;
|
||||
|
@ -43,7 +43,7 @@ struct SstFileWriter::Rep {
|
||||
std::unique_ptr<WritableFileWriter> file_writer;
|
||||
std::unique_ptr<TableBuilder> builder;
|
||||
EnvOptions env_options;
|
||||
ImmutableCFOptions ioptions;
|
||||
ImmutableOptions ioptions;
|
||||
MutableCFOptions mutable_cf_options;
|
||||
Env::IOPriority io_priority;
|
||||
InternalKeyComparator internal_comparator;
|
||||
|
@ -30,7 +30,7 @@ class Status;
|
||||
|
||||
struct TableReaderOptions {
|
||||
// @param skip_filters Disables loading/accessing the filter block
|
||||
TableReaderOptions(const ImmutableCFOptions& _ioptions,
|
||||
TableReaderOptions(const ImmutableOptions& _ioptions,
|
||||
const SliceTransform* _prefix_extractor,
|
||||
const EnvOptions& _env_options,
|
||||
const InternalKeyComparator& _internal_comparator,
|
||||
@ -45,7 +45,7 @@ struct TableReaderOptions {
|
||||
_max_file_size_for_l0_meta_pin) {}
|
||||
|
||||
// @param skip_filters Disables loading/accessing the filter block
|
||||
TableReaderOptions(const ImmutableCFOptions& _ioptions,
|
||||
TableReaderOptions(const ImmutableOptions& _ioptions,
|
||||
const SliceTransform* _prefix_extractor,
|
||||
const EnvOptions& _env_options,
|
||||
const InternalKeyComparator& _internal_comparator,
|
||||
@ -66,7 +66,7 @@ struct TableReaderOptions {
|
||||
block_cache_tracer(_block_cache_tracer),
|
||||
max_file_size_for_l0_meta_pin(_max_file_size_for_l0_meta_pin) {}
|
||||
|
||||
const ImmutableCFOptions& ioptions;
|
||||
const ImmutableOptions& ioptions;
|
||||
const SliceTransform* prefix_extractor;
|
||||
const EnvOptions& env_options;
|
||||
const InternalKeyComparator& internal_comparator;
|
||||
@ -91,7 +91,7 @@ struct TableReaderOptions {
|
||||
|
||||
struct TableBuilderOptions {
|
||||
TableBuilderOptions(
|
||||
const ImmutableCFOptions& _ioptions, const MutableCFOptions& _moptions,
|
||||
const ImmutableOptions& _ioptions, const MutableCFOptions& _moptions,
|
||||
const InternalKeyComparator& _internal_comparator,
|
||||
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
|
||||
_int_tbl_prop_collector_factories,
|
||||
@ -122,7 +122,7 @@ struct TableBuilderOptions {
|
||||
is_bottommost(_is_bottommost),
|
||||
reason(_reason) {}
|
||||
|
||||
const ImmutableCFOptions& ioptions;
|
||||
const ImmutableOptions& ioptions;
|
||||
const MutableCFOptions& moptions;
|
||||
const InternalKeyComparator& internal_comparator;
|
||||
const std::vector<std::unique_ptr<IntTblPropCollectorFactory>>*
|
||||
|
@ -86,7 +86,7 @@ void TableReaderBenchmark(Options& opts, EnvOptions& env_options,
|
||||
TableBuilder* tb = nullptr;
|
||||
DB* db = nullptr;
|
||||
Status s;
|
||||
const ImmutableCFOptions ioptions(opts);
|
||||
const ImmutableOptions ioptions(opts);
|
||||
const ColumnFamilyOptions cfo(opts);
|
||||
const MutableCFOptions moptions(cfo);
|
||||
std::unique_ptr<WritableFileWriter> file_writer;
|
||||
|
@ -175,7 +175,7 @@ class Constructor {
|
||||
// Finish constructing the data structure with all the keys that have
|
||||
// been added so far. Returns the keys in sorted order in "*keys"
|
||||
// and stores the key/value pairs in "*kvmap"
|
||||
void Finish(const Options& options, const ImmutableCFOptions& ioptions,
|
||||
void Finish(const Options& options, const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& moptions,
|
||||
const BlockBasedTableOptions& table_options,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
@ -194,7 +194,7 @@ class Constructor {
|
||||
|
||||
// Construct the data structure from the data in "data"
|
||||
virtual Status FinishImpl(const Options& options,
|
||||
const ImmutableCFOptions& ioptions,
|
||||
const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& moptions,
|
||||
const BlockBasedTableOptions& table_options,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
@ -286,7 +286,7 @@ class BlockConstructor : public Constructor {
|
||||
: Constructor(cmp), comparator_(cmp), block_(nullptr) {}
|
||||
~BlockConstructor() override { delete block_; }
|
||||
Status FinishImpl(const Options& /*options*/,
|
||||
const ImmutableCFOptions& /*ioptions*/,
|
||||
const ImmutableOptions& /*ioptions*/,
|
||||
const MutableCFOptions& /*moptions*/,
|
||||
const BlockBasedTableOptions& table_options,
|
||||
const InternalKeyComparator& /*internal_comparator*/,
|
||||
@ -341,7 +341,7 @@ class TableConstructor : public Constructor {
|
||||
}
|
||||
~TableConstructor() override { Reset(); }
|
||||
|
||||
Status FinishImpl(const Options& options, const ImmutableCFOptions& ioptions,
|
||||
Status FinishImpl(const Options& options, const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& moptions,
|
||||
const BlockBasedTableOptions& /*table_options*/,
|
||||
const InternalKeyComparator& internal_comparator,
|
||||
@ -427,7 +427,7 @@ class TableConstructor : public Constructor {
|
||||
key, TableReaderCaller::kUncategorized);
|
||||
}
|
||||
|
||||
virtual Status Reopen(const ImmutableCFOptions& ioptions,
|
||||
virtual Status Reopen(const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& moptions) {
|
||||
std::unique_ptr<FSRandomAccessFile> source(new test::StringSource(
|
||||
TEST_GetSink()->contents(), uniq_id_, ioptions.allow_mmap_reads));
|
||||
@ -489,20 +489,20 @@ class MemTableConstructor: public Constructor {
|
||||
write_buffer_manager_(wb),
|
||||
table_factory_(new SkipListFactory) {
|
||||
options_.memtable_factory = table_factory_;
|
||||
ImmutableCFOptions ioptions(options_);
|
||||
ImmutableOptions ioptions(options_);
|
||||
memtable_ =
|
||||
new MemTable(internal_comparator_, ioptions, MutableCFOptions(options_),
|
||||
wb, kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
memtable_->Ref();
|
||||
}
|
||||
~MemTableConstructor() override { delete memtable_->Unref(); }
|
||||
Status FinishImpl(const Options&, const ImmutableCFOptions& ioptions,
|
||||
Status FinishImpl(const Options&, const ImmutableOptions& ioptions,
|
||||
const MutableCFOptions& /*moptions*/,
|
||||
const BlockBasedTableOptions& /*table_options*/,
|
||||
const InternalKeyComparator& /*internal_comparator*/,
|
||||
const stl_wrappers::KVMap& kv_map) override {
|
||||
delete memtable_->Unref();
|
||||
ImmutableCFOptions mem_ioptions(ioptions);
|
||||
ImmutableOptions mem_ioptions(ioptions);
|
||||
memtable_ = new MemTable(internal_comparator_, mem_ioptions,
|
||||
MutableCFOptions(options_), write_buffer_manager_,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
@ -565,7 +565,7 @@ class DBConstructor: public Constructor {
|
||||
}
|
||||
~DBConstructor() override { delete db_; }
|
||||
Status FinishImpl(const Options& /*options*/,
|
||||
const ImmutableCFOptions& /*ioptions*/,
|
||||
const ImmutableOptions& /*ioptions*/,
|
||||
const MutableCFOptions& /*moptions*/,
|
||||
const BlockBasedTableOptions& /*table_options*/,
|
||||
const InternalKeyComparator& /*internal_comparator*/,
|
||||
@ -857,7 +857,7 @@ class HarnessTest : public testing::Test {
|
||||
constructor_.reset(new DBConstructor(options_.comparator));
|
||||
break;
|
||||
}
|
||||
ioptions_ = ImmutableCFOptions(options_);
|
||||
ioptions_ = ImmutableOptions(options_);
|
||||
moptions_ = MutableCFOptions(options_);
|
||||
}
|
||||
|
||||
@ -1060,7 +1060,7 @@ class HarnessTest : public testing::Test {
|
||||
private:
|
||||
TestArgs args_;
|
||||
Options options_;
|
||||
ImmutableCFOptions ioptions_;
|
||||
ImmutableOptions ioptions_;
|
||||
MutableCFOptions moptions_;
|
||||
BlockBasedTableOptions table_options_;
|
||||
std::unique_ptr<Constructor> constructor_;
|
||||
@ -1411,7 +1411,7 @@ TEST_P(BlockBasedTableTest, BasicBlockBasedTableProperties) {
|
||||
table_options.block_restart_interval = 1;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -1459,7 +1459,7 @@ uint64_t BlockBasedTableTest::IndexUncompressedHelper(bool compressed) {
|
||||
table_options.enable_index_compression = compressed;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -1485,7 +1485,7 @@ TEST_P(BlockBasedTableTest, BlockBasedTableProperties2) {
|
||||
BlockBasedTableOptions table_options = GetBlockBasedTableOptions();
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -1519,7 +1519,7 @@ TEST_P(BlockBasedTableTest, BlockBasedTableProperties2) {
|
||||
options.table_properties_collector_factories.emplace_back(
|
||||
new DummyPropertiesCollectorFactory2());
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -1563,7 +1563,7 @@ TEST_P(BlockBasedTableTest, RangeDelBlock) {
|
||||
table_options.block_restart_interval = 1;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
std::unique_ptr<InternalKeyComparator> internal_cmp(
|
||||
new InternalKeyComparator(options.comparator));
|
||||
@ -1607,7 +1607,7 @@ TEST_P(BlockBasedTableTest, FilterPolicyNameProperties) {
|
||||
Options options;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -1651,7 +1651,7 @@ void PrefetchRange(TableConstructor* c, Options* opt,
|
||||
// reset the cache and reopen the table
|
||||
table_options->block_cache = NewLRUCache(16 * 1024 * 1024, 4);
|
||||
opt->table_factory.reset(NewBlockBasedTableFactory(*table_options));
|
||||
const ImmutableCFOptions ioptions2(*opt);
|
||||
const ImmutableOptions ioptions2(*opt);
|
||||
const MutableCFOptions moptions(*opt);
|
||||
ASSERT_OK(c->Reopen(ioptions2, moptions));
|
||||
|
||||
@ -1709,7 +1709,7 @@ TEST_P(BlockBasedTableTest, PrefetchTest) {
|
||||
c.Add("k07", std::string(100000, 'x'));
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(opt);
|
||||
const ImmutableOptions ioptions(opt);
|
||||
const MutableCFOptions moptions(opt);
|
||||
c.Finish(opt, ioptions, moptions, table_options, *ikc, &keys, &kvmap);
|
||||
c.ResetTableReader();
|
||||
@ -1810,7 +1810,7 @@ TEST_P(BlockBasedTableTest, TotalOrderSeekOnHashIndex) {
|
||||
c.Add("cccc2", std::string('a', 56));
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -1869,7 +1869,7 @@ TEST_P(BlockBasedTableTest, NoopTransformSeek) {
|
||||
c.Add(key.Encode().ToString(), "b");
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
const InternalKeyComparator internal_comparator(options.comparator);
|
||||
c.Finish(options, ioptions, moptions, table_options, internal_comparator,
|
||||
@ -1907,14 +1907,14 @@ TEST_P(BlockBasedTableTest, SkipPrefixBloomFilter) {
|
||||
c.Add(key.Encode().ToString(), "test");
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
const InternalKeyComparator internal_comparator(options.comparator);
|
||||
c.Finish(options, ioptions, moptions, table_options, internal_comparator,
|
||||
&keys, &kvmap);
|
||||
// TODO(Zhongyi): update test to use MutableCFOptions
|
||||
options.prefix_extractor.reset(NewFixedPrefixTransform(9));
|
||||
const ImmutableCFOptions new_ioptions(options);
|
||||
const ImmutableOptions new_ioptions(options);
|
||||
const MutableCFOptions new_moptions(options);
|
||||
ASSERT_OK(c.Reopen(new_ioptions, new_moptions));
|
||||
auto reader = c.GetTableReader();
|
||||
@ -1971,7 +1971,7 @@ void TableTest::IndexTest(BlockBasedTableOptions table_options) {
|
||||
|
||||
std::unique_ptr<InternalKeyComparator> comparator(
|
||||
new InternalKeyComparator(BytewiseComparator()));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options, *comparator, &keys,
|
||||
&kvmap);
|
||||
@ -2174,7 +2174,7 @@ TEST_P(BlockBasedTableTest, IndexSeekOptimizationIncomplete) {
|
||||
BlockBasedTableOptions table_options = GetBlockBasedTableOptions();
|
||||
Options options;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
|
||||
TableConstructor c(BytewiseComparator());
|
||||
@ -2261,7 +2261,7 @@ TEST_P(BlockBasedTableTest, BinaryIndexWithFirstKey2) {
|
||||
Statistics* stats = options.statistics.get();
|
||||
std::unique_ptr<InternalKeyComparator> comparator(
|
||||
new InternalKeyComparator(BytewiseComparator()));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
|
||||
TableConstructor c(BytewiseComparator());
|
||||
@ -2459,7 +2459,7 @@ TEST_P(BlockBasedTableTest, BinaryIndexWithFirstKeyGlobalSeqno) {
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
std::unique_ptr<InternalKeyComparator> comparator(
|
||||
new InternalKeyComparator(BytewiseComparator()));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
|
||||
TableConstructor c(BytewiseComparator(), /* convert_to_internal_key */ false,
|
||||
@ -2534,7 +2534,7 @@ TEST_P(BlockBasedTableTest, IndexSizeStat) {
|
||||
table_options.block_restart_interval = 1;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &ks, &kvmap);
|
||||
@ -2563,7 +2563,7 @@ TEST_P(BlockBasedTableTest, NumBlockStat) {
|
||||
|
||||
std::vector<std::string> ks;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &ks, &kvmap);
|
||||
@ -2584,7 +2584,7 @@ TEST_P(BlockBasedTableTest, TracingGetTest) {
|
||||
SetupTracingTest(&c);
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -2658,7 +2658,7 @@ TEST_P(BlockBasedTableTest, TracingApproximateOffsetOfTest) {
|
||||
SetupTracingTest(&c);
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -2702,7 +2702,7 @@ TEST_P(BlockBasedTableTest, TracingIterator) {
|
||||
SetupTracingTest(&c);
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -2832,7 +2832,7 @@ TEST_P(BlockBasedTableTest, BlockCacheDisabledTest) {
|
||||
|
||||
TableConstructor c(BytewiseComparator(), true /* convert_to_internal_key_ */);
|
||||
c.Add("key", "value");
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -2884,7 +2884,7 @@ TEST_P(BlockBasedTableTest, FilterBlockInBlockCache) {
|
||||
|
||||
TableConstructor c(BytewiseComparator(), true /* convert_to_internal_key_ */);
|
||||
c.Add("key", "value");
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
GetPlainInternalComparator(options.comparator), &keys, &kvmap);
|
||||
@ -2964,7 +2964,7 @@ TEST_P(BlockBasedTableTest, FilterBlockInBlockCache) {
|
||||
table_options.block_cache = NewLRUCache(1, 4);
|
||||
options.statistics = CreateDBStatistics();
|
||||
options.table_factory.reset(new BlockBasedTableFactory(table_options));
|
||||
const ImmutableCFOptions ioptions2(options);
|
||||
const ImmutableOptions ioptions2(options);
|
||||
const MutableCFOptions moptions2(options);
|
||||
ASSERT_OK(c.Reopen(ioptions2, moptions2));
|
||||
{
|
||||
@ -3011,7 +3011,7 @@ TEST_P(BlockBasedTableTest, FilterBlockInBlockCache) {
|
||||
std::string user_key = "k01";
|
||||
InternalKey internal_key(user_key, 0, kTypeValue);
|
||||
c3.Add(internal_key.Encode().ToString(), "hello");
|
||||
ImmutableCFOptions ioptions3(options);
|
||||
ImmutableOptions ioptions3(options);
|
||||
MutableCFOptions moptions3(options);
|
||||
// Generate table without filter policy
|
||||
c3.Finish(options, ioptions3, moptions3, table_options,
|
||||
@ -3022,7 +3022,7 @@ TEST_P(BlockBasedTableTest, FilterBlockInBlockCache) {
|
||||
table_options.filter_policy.reset(NewBloomFilterPolicy(1));
|
||||
options.table_factory.reset(new BlockBasedTableFactory(table_options));
|
||||
options.statistics = CreateDBStatistics();
|
||||
ImmutableCFOptions ioptions4(options);
|
||||
ImmutableOptions ioptions4(options);
|
||||
MutableCFOptions moptions4(options);
|
||||
ASSERT_OK(c3.Reopen(ioptions4, moptions4));
|
||||
reader = dynamic_cast<BlockBasedTable*>(c3.GetTableReader());
|
||||
@ -3106,7 +3106,7 @@ TEST_P(BlockBasedTableTest, BlockReadCountTest) {
|
||||
InternalKey internal_key(user_key, 0, kTypeValue);
|
||||
std::string encoded_key = internal_key.Encode().ToString();
|
||||
c.Add(encoded_key, "hello");
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
// Generate table with filter policy
|
||||
c.Finish(options, ioptions, moptions, table_options,
|
||||
@ -3194,7 +3194,7 @@ TEST_P(BlockBasedTableTest, BlockCacheLeak) {
|
||||
c.Add("k07", std::string(100000, 'x'));
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(opt);
|
||||
const ImmutableOptions ioptions(opt);
|
||||
const MutableCFOptions moptions(opt);
|
||||
c.Finish(opt, ioptions, moptions, table_options, *ikc, &keys, &kvmap);
|
||||
|
||||
@ -3209,7 +3209,7 @@ TEST_P(BlockBasedTableTest, BlockCacheLeak) {
|
||||
ASSERT_OK(iter->status());
|
||||
iter.reset();
|
||||
|
||||
const ImmutableCFOptions ioptions1(opt);
|
||||
const ImmutableOptions ioptions1(opt);
|
||||
const MutableCFOptions moptions1(opt);
|
||||
ASSERT_OK(c.Reopen(ioptions1, moptions1));
|
||||
auto table_reader = dynamic_cast<BlockBasedTable*>(c.GetTableReader());
|
||||
@ -3222,7 +3222,7 @@ TEST_P(BlockBasedTableTest, BlockCacheLeak) {
|
||||
// rerun with different block cache
|
||||
table_options.block_cache = NewLRUCache(16 * 1024 * 1024, 4);
|
||||
opt.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
const ImmutableCFOptions ioptions2(opt);
|
||||
const ImmutableOptions ioptions2(opt);
|
||||
const MutableCFOptions moptions2(opt);
|
||||
ASSERT_OK(c.Reopen(ioptions2, moptions2));
|
||||
table_reader = dynamic_cast<BlockBasedTable*>(c.GetTableReader());
|
||||
@ -3282,7 +3282,7 @@ TEST_P(BlockBasedTableTest, MemoryAllocator) {
|
||||
c.Add("k07", std::string(100000, 'x'));
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(opt);
|
||||
const ImmutableOptions ioptions(opt);
|
||||
const MutableCFOptions moptions(opt);
|
||||
c.Finish(opt, ioptions, moptions, table_options, *ikc, &keys, &kvmap);
|
||||
|
||||
@ -3308,7 +3308,7 @@ TEST_P(BlockBasedTableTest, MemoryAllocator) {
|
||||
// Test the file checksum of block based table
|
||||
TEST_P(BlockBasedTableTest, NoFileChecksum) {
|
||||
Options options;
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
BlockBasedTableOptions table_options = GetBlockBasedTableOptions();
|
||||
std::unique_ptr<InternalKeyComparator> comparator(
|
||||
@ -3339,7 +3339,7 @@ TEST_P(BlockBasedTableTest, Crc32cFileChecksum) {
|
||||
new FileChecksumGenCrc32cFactory();
|
||||
Options options;
|
||||
options.file_checksum_gen_factory.reset(file_checksum_gen_factory);
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
BlockBasedTableOptions table_options = GetBlockBasedTableOptions();
|
||||
std::unique_ptr<InternalKeyComparator> comparator(
|
||||
@ -3400,7 +3400,7 @@ TEST_F(PlainTableTest, BasicPlainTableProperties) {
|
||||
std::unique_ptr<WritableFileWriter> file_writer(new WritableFileWriter(
|
||||
std::move(sink), "" /* don't care */, FileOptions()));
|
||||
Options options;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
InternalKeyComparator ikc(options.comparator);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
@ -3453,7 +3453,7 @@ TEST_F(PlainTableTest, NoFileChecksum) {
|
||||
PlainTableFactory factory(plain_table_options);
|
||||
|
||||
Options options;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
InternalKeyComparator ikc(options.comparator);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
@ -3487,7 +3487,7 @@ TEST_F(PlainTableTest, Crc32cFileChecksum) {
|
||||
new FileChecksumGenCrc32cFactory();
|
||||
Options options;
|
||||
options.file_checksum_gen_factory.reset(file_checksum_gen_factory);
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
InternalKeyComparator ikc(options.comparator);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
@ -3542,7 +3542,7 @@ TEST_F(GeneralTableTest, ApproximateOffsetOfPlain) {
|
||||
options.compression = kNoCompression;
|
||||
BlockBasedTableOptions table_options;
|
||||
table_options.block_size = 1024;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options, internal_comparator,
|
||||
&keys, &kvmap);
|
||||
@ -3578,7 +3578,7 @@ static void DoCompressionTest(CompressionType comp) {
|
||||
options.compression = comp;
|
||||
BlockBasedTableOptions table_options;
|
||||
table_options.block_size = 1024;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options, ikc, &keys, &kvmap);
|
||||
|
||||
@ -3676,7 +3676,7 @@ class MemTableTest : public testing::Test {
|
||||
InternalKeyComparator cmp(BytewiseComparator());
|
||||
auto table_factory = std::make_shared<SkipListFactory>();
|
||||
options_.memtable_factory = table_factory;
|
||||
ImmutableCFOptions ioptions(options_);
|
||||
ImmutableOptions ioptions(options_);
|
||||
wb_ = new WriteBufferManager(options_.db_write_buffer_size);
|
||||
memtable_ = new MemTable(cmp, ioptions, MutableCFOptions(options_), wb_,
|
||||
kMaxSequenceNumber, 0 /* column_family_id */);
|
||||
@ -3930,7 +3930,7 @@ TEST_P(IndexBlockRestartIntervalTest, IndexBlockRestartInterval) {
|
||||
stl_wrappers::KVMap kvmap;
|
||||
std::unique_ptr<InternalKeyComparator> comparator(
|
||||
new InternalKeyComparator(BytewiseComparator()));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_options, *comparator, &keys,
|
||||
&kvmap);
|
||||
@ -4060,7 +4060,7 @@ TEST_P(BlockBasedTableTest, DISABLED_TableWithGlobalSeqno) {
|
||||
std::move(holder), "" /* don't care */, FileOptions()));
|
||||
Options options;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(bbto));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
InternalKeyComparator ikc(options.comparator);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
@ -4248,7 +4248,7 @@ TEST_P(BlockBasedTableTest, BlockAlignTest) {
|
||||
Options options;
|
||||
options.compression = kNoCompression;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(bbto));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
InternalKeyComparator ikc(options.comparator);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
@ -4299,7 +4299,7 @@ TEST_P(BlockBasedTableTest, BlockAlignTest) {
|
||||
bbto.block_align = false;
|
||||
Options options2;
|
||||
options2.table_factory.reset(NewBlockBasedTableFactory(bbto));
|
||||
ImmutableCFOptions ioptions2(options2);
|
||||
ImmutableOptions ioptions2(options2);
|
||||
const MutableCFOptions moptions2(options2);
|
||||
|
||||
ASSERT_OK(ioptions.table_factory->NewTableReader(
|
||||
@ -4341,7 +4341,7 @@ TEST_P(BlockBasedTableTest, PropertiesBlockRestartPointTest) {
|
||||
options.compression = kNoCompression;
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(bbto));
|
||||
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
InternalKeyComparator ikc(options.comparator);
|
||||
std::vector<std::unique_ptr<IntTblPropCollectorFactory>>
|
||||
@ -4448,7 +4448,7 @@ TEST_P(BlockBasedTableTest, PropertiesMetaBlockLast) {
|
||||
table_options.filter_policy.reset(NewBloomFilterPolicy(
|
||||
8 /* bits_per_key */, false /* use_block_based_filter */));
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
||||
ImmutableCFOptions ioptions(options);
|
||||
ImmutableOptions ioptions(options);
|
||||
MutableCFOptions moptions(options);
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
@ -4597,7 +4597,7 @@ TEST_P(BlockBasedTableTest, DataBlockHashIndex) {
|
||||
|
||||
std::vector<std::string> keys;
|
||||
stl_wrappers::KVMap kvmap;
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
const InternalKeyComparator internal_comparator(options.comparator);
|
||||
c.Finish(options, ioptions, moptions, table_options, internal_comparator,
|
||||
@ -4680,7 +4680,7 @@ TEST_P(BlockBasedTableTest, OutOfBoundOnSeek) {
|
||||
Options options;
|
||||
BlockBasedTableOptions table_opt(GetBlockBasedTableOptions());
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_opt));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_opt,
|
||||
GetPlainInternalComparator(BytewiseComparator()), &keys, &kvmap);
|
||||
@ -4720,7 +4720,7 @@ TEST_P(BlockBasedTableTest, OutOfBoundOnNext) {
|
||||
table_opt.flush_block_policy_factory =
|
||||
std::make_shared<FlushBlockEveryKeyPolicyFactory>();
|
||||
options.table_factory.reset(NewBlockBasedTableFactory(table_opt));
|
||||
const ImmutableCFOptions ioptions(options);
|
||||
const ImmutableOptions ioptions(options);
|
||||
const MutableCFOptions moptions(options);
|
||||
c.Finish(options, ioptions, moptions, table_opt,
|
||||
GetPlainInternalComparator(BytewiseComparator()), &keys, &kvmap);
|
||||
|
@ -96,7 +96,7 @@ class SSTDumpToolTest : public testing::Test {
|
||||
Env* test_env = opts.env;
|
||||
FileOptions file_options(opts);
|
||||
ReadOptions read_options;
|
||||
const ImmutableCFOptions imoptions(opts);
|
||||
const ImmutableOptions imoptions(opts);
|
||||
const MutableCFOptions moptions(opts);
|
||||
ROCKSDB_NAMESPACE::InternalKeyComparator ikc(opts.comparator);
|
||||
std::unique_ptr<TableBuilder> tb;
|
||||
|
@ -215,8 +215,7 @@ Status BlobDumpTool::DumpRecord(DisplayType show_key, DisplayType show_blob,
|
||||
compression);
|
||||
s = UncompressBlockContentsForCompressionType(
|
||||
info, slice.data() + key_size, static_cast<size_t>(value_size),
|
||||
&contents, 2 /*compress_format_version*/,
|
||||
ImmutableCFOptions(Options()));
|
||||
&contents, 2 /*compress_format_version*/, ImmutableOptions(Options()));
|
||||
if (!s.ok()) {
|
||||
return s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user