@@ -356,7 +356,7 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname)
356
356
default_interval_to_delete_obsolete_WAL_(600 ),
357
357
flush_on_destroy_(false ),
358
358
delayed_writes_(0 ),
359
- storage_options_ (options),
359
+ env_options_ (options),
360
360
bg_work_gate_closed_(false ),
361
361
refitting_level_(false ),
362
362
opened_successfully_(false ) {
@@ -372,7 +372,7 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname)
372
372
options_.table_cache_remove_scan_count_limit );
373
373
374
374
versions_.reset (
375
- new VersionSet (dbname_, &options_, storage_options_ , table_cache_.get ()));
375
+ new VersionSet (dbname_, &options_, env_options_ , table_cache_.get ()));
376
376
column_family_memtables_.reset (
377
377
new ColumnFamilyMemTablesImpl (versions_->GetColumnFamilySet ()));
378
378
@@ -453,7 +453,7 @@ Status DBImpl::NewDB() {
453
453
const std::string manifest = DescriptorFileName (dbname_, 1 );
454
454
unique_ptr<WritableFile> file;
455
455
Status s = env_->NewWritableFile (
456
- manifest, &file, env_->OptimizeForManifestWrite (storage_options_ ));
456
+ manifest, &file, env_->OptimizeForManifestWrite (env_options_ ));
457
457
if (!s.ok ()) {
458
458
return s;
459
459
}
@@ -1075,7 +1075,7 @@ Status DBImpl::ReadFirstLine(const std::string& fname,
1075
1075
};
1076
1076
1077
1077
unique_ptr<SequentialFile> file;
1078
- Status status = env_->NewSequentialFile (fname, &file, storage_options_ );
1078
+ Status status = env_->NewSequentialFile (fname, &file, env_options_ );
1079
1079
1080
1080
if (!status.ok ()) {
1081
1081
return status;
@@ -1275,7 +1275,7 @@ Status DBImpl::RecoverLogFile(uint64_t log_number, SequenceNumber* max_sequence,
1275
1275
// Open the log file
1276
1276
std::string fname = LogFileName (options_.wal_dir , log_number);
1277
1277
unique_ptr<SequentialFile> file;
1278
- Status status = env_->NewSequentialFile (fname, &file, storage_options_ );
1278
+ Status status = env_->NewSequentialFile (fname, &file, env_options_ );
1279
1279
if (!status.ok ()) {
1280
1280
MaybeIgnoreError (&status);
1281
1281
return status;
@@ -1425,10 +1425,11 @@ Status DBImpl::WriteLevel0TableForRecovery(ColumnFamilyData* cfd, MemTable* mem,
1425
1425
Status s;
1426
1426
{
1427
1427
mutex_.Unlock ();
1428
- s = BuildTable (dbname_, env_, *cfd->options (), storage_options_ ,
1428
+ s = BuildTable (dbname_, env_, *cfd->ioptions (), env_options_ ,
1429
1429
cfd->table_cache (), iter, &meta, cfd->internal_comparator (),
1430
1430
newest_snapshot, earliest_seqno_in_memtable,
1431
- GetCompressionFlush (*cfd->options ()), Env::IO_HIGH);
1431
+ GetCompressionFlush (*cfd->options ()),
1432
+ cfd->options ()->compression_opts , Env::IO_HIGH);
1432
1433
LogFlush (options_.info_log );
1433
1434
mutex_.Lock ();
1434
1435
}
@@ -1495,10 +1496,11 @@ Status DBImpl::WriteLevel0Table(ColumnFamilyData* cfd,
1495
1496
Log (options_.info_log , " [%s] Level-0 flush table #%" PRIu64 " : started" ,
1496
1497
cfd->GetName ().c_str (), meta.fd .GetNumber ());
1497
1498
1498
- s = BuildTable (dbname_, env_, *cfd->options (), storage_options_ ,
1499
+ s = BuildTable (dbname_, env_, *cfd->ioptions (), env_options_ ,
1499
1500
cfd->table_cache (), iter, &meta, cfd->internal_comparator (),
1500
1501
newest_snapshot, earliest_seqno_in_memtable,
1501
- GetCompressionFlush (*cfd->options ()), Env::IO_HIGH);
1502
+ GetCompressionFlush (*cfd->options ()),
1503
+ cfd->options ()->compression_opts , Env::IO_HIGH);
1502
1504
LogFlush (options_.info_log );
1503
1505
delete iter;
1504
1506
Log (options_.info_log ,
@@ -2447,7 +2449,7 @@ Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) {
2447
2449
// Make the output file
2448
2450
std::string fname = TableFileName (options_.db_paths , file_number,
2449
2451
compact->compaction ->GetOutputPathId ());
2450
- Status s = env_->NewWritableFile (fname, &compact->outfile , storage_options_ );
2452
+ Status s = env_->NewWritableFile (fname, &compact->outfile , env_options_ );
2451
2453
2452
2454
if (s.ok ()) {
2453
2455
compact->outfile ->SetIOPriority (Env::IO_LOW);
@@ -2456,8 +2458,9 @@ Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) {
2456
2458
2457
2459
ColumnFamilyData* cfd = compact->compaction ->column_family_data ();
2458
2460
compact->builder .reset (NewTableBuilder (
2459
- *cfd->options (), cfd->internal_comparator (), compact->outfile .get (),
2460
- compact->compaction ->OutputCompressionType ()));
2461
+ *cfd->ioptions (), cfd->internal_comparator (), compact->outfile .get (),
2462
+ compact->compaction ->OutputCompressionType (),
2463
+ cfd->options ()->compression_opts ));
2461
2464
}
2462
2465
LogFlush (options_.info_log );
2463
2466
return s;
@@ -2506,7 +2509,7 @@ Status DBImpl::FinishCompactionOutputFile(CompactionState* compact,
2506
2509
ColumnFamilyData* cfd = compact->compaction ->column_family_data ();
2507
2510
FileDescriptor fd (output_number, output_path_id, current_bytes);
2508
2511
Iterator* iter = cfd->table_cache ()->NewIterator (
2509
- ReadOptions (), storage_options_ , cfd->internal_comparator (), fd);
2512
+ ReadOptions (), env_options_ , cfd->internal_comparator (), fd);
2510
2513
s = iter->status ();
2511
2514
delete iter;
2512
2515
if (s.ok ()) {
@@ -3355,7 +3358,7 @@ Iterator* DBImpl::NewInternalIterator(const ReadOptions& options,
3355
3358
// Collect all needed child iterators for immutable memtables
3356
3359
super_version->imm ->AddIterators (options, &merge_iter_builder);
3357
3360
// Collect iterators for files in L0 - Ln
3358
- super_version->current ->AddIterators (options, storage_options_ ,
3361
+ super_version->current ->AddIterators (options, env_options_ ,
3359
3362
&merge_iter_builder);
3360
3363
internal_iter = merge_iter_builder.Finish ();
3361
3364
} else {
@@ -3366,7 +3369,7 @@ Iterator* DBImpl::NewInternalIterator(const ReadOptions& options,
3366
3369
// Collect all needed child iterators for immutable memtables
3367
3370
super_version->imm ->AddIterators (options, &iterator_list);
3368
3371
// Collect iterators for files in L0 - Ln
3369
- super_version->current ->AddIterators (options, storage_options_ ,
3372
+ super_version->current ->AddIterators (options, env_options_ ,
3370
3373
&iterator_list);
3371
3374
internal_iter = NewMergingIterator (&cfd->internal_comparator (),
3372
3375
&iterator_list[0 ], iterator_list.size ());
@@ -4377,7 +4380,7 @@ Status DBImpl::SetNewMemtableAndNewLogFile(ColumnFamilyData* cfd,
4377
4380
if (creating_new_log) {
4378
4381
s = env_->NewWritableFile (LogFileName (options_.wal_dir , new_log_number),
4379
4382
&lfile,
4380
- env_->OptimizeForLogWrite (storage_options_ ));
4383
+ env_->OptimizeForLogWrite (env_options_ ));
4381
4384
if (s.ok ()) {
4382
4385
// Our final size should be less than write_buffer_size
4383
4386
// (compression, etc) but err on the side of caution.
@@ -4615,7 +4618,7 @@ Status DBImpl::GetUpdatesSince(
4615
4618
return s;
4616
4619
}
4617
4620
iter->reset (new TransactionLogIteratorImpl (options_.wal_dir , &options_,
4618
- read_options, storage_options_ ,
4621
+ read_options, env_options_ ,
4619
4622
seq, std::move (wal_files), this ));
4620
4623
return (*iter)->status ();
4621
4624
}
0 commit comments