|
|
|
@ -27,7 +27,7 @@ const size_t kFadviseTrigger = 1024 * 1024; // 1MB |
|
|
|
|
struct SstFileWriter::Rep { |
|
|
|
|
Rep(const EnvOptions& _env_options, const Options& options, |
|
|
|
|
Env::IOPriority _io_priority, const Comparator* _user_comparator, |
|
|
|
|
ColumnFamilyHandle* _cfh, bool _invalidate_page_cache) |
|
|
|
|
ColumnFamilyHandle* _cfh, bool _invalidate_page_cache, bool _skip_filters) |
|
|
|
|
: env_options(_env_options), |
|
|
|
|
ioptions(options), |
|
|
|
|
mutable_cf_options(options), |
|
|
|
@ -35,7 +35,8 @@ struct SstFileWriter::Rep { |
|
|
|
|
internal_comparator(_user_comparator), |
|
|
|
|
cfh(_cfh), |
|
|
|
|
invalidate_page_cache(_invalidate_page_cache), |
|
|
|
|
last_fadvise_size(0) {} |
|
|
|
|
last_fadvise_size(0), |
|
|
|
|
skip_filters(_skip_filters) {} |
|
|
|
|
|
|
|
|
|
std::unique_ptr<WritableFileWriter> file_writer; |
|
|
|
|
std::unique_ptr<TableBuilder> builder; |
|
|
|
@ -54,6 +55,7 @@ struct SstFileWriter::Rep { |
|
|
|
|
// The size of the file during the last time we called Fadvise to remove
|
|
|
|
|
// cached pages from page cache.
|
|
|
|
|
uint64_t last_fadvise_size; |
|
|
|
|
bool skip_filters; |
|
|
|
|
Status Add(const Slice& user_key, const Slice& value, |
|
|
|
|
const ValueType value_type) { |
|
|
|
|
if (!builder) { |
|
|
|
@ -122,9 +124,9 @@ SstFileWriter::SstFileWriter(const EnvOptions& env_options, |
|
|
|
|
const Comparator* user_comparator, |
|
|
|
|
ColumnFamilyHandle* column_family, |
|
|
|
|
bool invalidate_page_cache, |
|
|
|
|
Env::IOPriority io_priority) |
|
|
|
|
Env::IOPriority io_priority, bool skip_filters) |
|
|
|
|
: rep_(new Rep(env_options, options, io_priority, user_comparator, |
|
|
|
|
column_family, invalidate_page_cache)) { |
|
|
|
|
column_family, invalidate_page_cache, skip_filters)) { |
|
|
|
|
rep_->file_info.file_size = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -189,8 +191,8 @@ Status SstFileWriter::Open(const std::string& file_path) { |
|
|
|
|
TableBuilderOptions table_builder_options( |
|
|
|
|
r->ioptions, r->internal_comparator, &int_tbl_prop_collector_factories, |
|
|
|
|
compression_type, r->ioptions.compression_opts, |
|
|
|
|
nullptr /* compression_dict */, false /* skip_filters */, |
|
|
|
|
r->column_family_name, unknown_level); |
|
|
|
|
nullptr /* compression_dict */, r->skip_filters, r->column_family_name, |
|
|
|
|
unknown_level); |
|
|
|
|
r->file_writer.reset( |
|
|
|
|
new WritableFileWriter(std::move(sst_file), r->env_options)); |
|
|
|
|
|
|
|
|
|