diff --git a/sstables/mx/writer.cc b/sstables/mx/writer.cc index cf33e151ad..68f8640528 100644 --- a/sstables/mx/writer.cc +++ b/sstables/mx/writer.cc @@ -884,17 +884,17 @@ void writer::init_file_writers() { auto out = _sst._storage->make_data_or_index_sink(_sst, component_type::Data).get(); if (!_compression_enabled) { - _data_writer = std::make_unique(std::move(out), _sst.sstable_buffer_size, _sst.filename(component_type::Data)); + _data_writer = std::make_unique(std::move(out), _sst.sstable_buffer_size, _sst.get_filename()); } else { _data_writer = std::make_unique( make_compressed_file_m_format_output_stream( output_stream(std::move(out)), &_sst._components->compression, - _sst._schema->get_compressor_params()), _sst.filename(component_type::Data)); + _sst._schema->get_compressor_params()), _sst.get_filename()); } out = _sst._storage->make_data_or_index_sink(_sst, component_type::Index).get(); - _index_writer = std::make_unique(output_stream(std::move(out)), _sst.filename(component_type::Index)); + _index_writer = std::make_unique(output_stream(std::move(out)), _sst.index_filename()); } std::unique_ptr writer::close_writer(std::unique_ptr& w) { diff --git a/sstables/sstables.cc b/sstables/sstables.cc index b65bdcd05c..07a22b1d8b 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -838,16 +838,16 @@ future<> sstable::read_toc() noexcept { _recognized_components.insert(reverse_map(c, sstable_version_constants::get_component_map(_version))); } catch (std::out_of_range& oor) { _unrecognized_components.push_back(c); - sstlog.info("Unrecognized TOC component was found: {} in sstable {}", c, filename(component_type::TOC)); + sstlog.info("Unrecognized TOC component was found: {} in sstable {}", c, toc_filename()); } } if (!_recognized_components.size()) { - throw malformed_sstable_exception("Empty TOC", filename(component_type::TOC)); + throw malformed_sstable_exception("Empty TOC", toc_filename()); } }); } catch (std::system_error& e) { if (e.code() == std::error_code(ENOENT, std::system_category())) { - throw malformed_sstable_exception(filename(component_type::TOC) + ": file not found"); + throw malformed_sstable_exception(toc_filename() + ": file not found"); } throw; } diff --git a/test/lib/sstable_utils.hh b/test/lib/sstable_utils.hh index a15f62a976..315d7088a7 100644 --- a/test/lib/sstable_utils.hh +++ b/test/lib/sstable_utils.hh @@ -155,7 +155,7 @@ public: void rewrite_toc_without_component(component_type component) { SCYLLA_ASSERT(component != component_type::TOC); _sst->_recognized_components.erase(component); - remove_file(_sst->filename(component_type::TOC)).get(); + remove_file(_sst->toc_filename()).get(); _sst->_storage->open(*_sst); _sst->seal_sstable(false).get(); }