|
11 | 11 | #include "db/dbformat.h"
|
12 | 12 | #include "db/table_properties_collector.h"
|
13 | 13 | #include "rocksdb/table.h"
|
| 14 | +#include "rocksdb/immutable_options.h" |
14 | 15 | #include "table/block_based_table_factory.h"
|
15 | 16 | #include "table/meta_blocks.h"
|
16 | 17 | #include "table/plain_table_factory.h"
|
@@ -85,12 +86,13 @@ class DumbLogger : public Logger {
|
85 | 86 | // Utilities test functions
|
86 | 87 | namespace {
|
87 | 88 | void MakeBuilder(const Options& options,
|
| 89 | + const ImmutableCFOptions& ioptions, |
88 | 90 | const InternalKeyComparator& internal_comparator,
|
89 | 91 | std::unique_ptr<FakeWritableFile>* writable,
|
90 | 92 | std::unique_ptr<TableBuilder>* builder) {
|
91 | 93 | writable->reset(new FakeWritableFile);
|
92 |
| - builder->reset(options.table_factory->NewTableBuilder( |
93 |
| - ImmutableCFOptions(options), internal_comparator, writable->get(), |
| 94 | + builder->reset(ioptions.table_factory->NewTableBuilder( |
| 95 | + ioptions, internal_comparator, writable->get(), |
94 | 96 | options.compression, options.compression_opts));
|
95 | 97 | }
|
96 | 98 | } // namespace
|
@@ -154,7 +156,8 @@ void TestCustomizedTablePropertiesCollector(
|
154 | 156 | // -- Step 1: build table
|
155 | 157 | std::unique_ptr<TableBuilder> builder;
|
156 | 158 | std::unique_ptr<FakeWritableFile> writable;
|
157 |
| - MakeBuilder(options, internal_comparator, &writable, &builder); |
| 159 | + const ImmutableCFOptions ioptions(options); |
| 160 | + MakeBuilder(options, ioptions, internal_comparator, &writable, &builder); |
158 | 161 |
|
159 | 162 | for (const auto& kv : kvs) {
|
160 | 163 | if (encode_as_internal) {
|
@@ -265,9 +268,10 @@ void TestInternalKeyPropertiesCollector(
|
265 | 268 | options.table_properties_collector_factories = {
|
266 | 269 | std::make_shared<InternalKeyPropertiesCollectorFactory>()};
|
267 | 270 | }
|
| 271 | + const ImmutableCFOptions ioptions(options); |
268 | 272 |
|
269 | 273 | for (int iter = 0; iter < 2; ++iter) {
|
270 |
| - MakeBuilder(options, pikc, &writable, &builder); |
| 274 | + MakeBuilder(options, ioptions, pikc, &writable, &builder); |
271 | 275 | for (const auto& k : keys) {
|
272 | 276 | builder->Add(k.Encode(), "val");
|
273 | 277 | }
|
|
0 commit comments