The namespace usage in this directory is very inconsistent, with files
and classes scattered in:
* global namespace
* namespace compaction
* namespace sstables
With cases, where all three used in the same file. This code used to
live in sstables/ and some of it still retains namespace sstables as a
heritage of that time. The mismatch between the dir (future module) and
the namespace used is confusing, so finish the migration and move all
code in compaction/ to namespace compaction too.
This patch, although large, is mechanic and only the following kind of
changes are made:
* replace namespace sstable {} with namespace compaction {}
* add namespace compaction {}
* drop/add sstables::
* drop/add compaction::
* move around forward-declarations so they are in the correct namespace
context
This refactoring revealed some awkward leftover coupling between
sstables and compaction, in sstables/sstable_set.cc, where the
make_sstable_set() methods of compaction strategies are implemented.
40 lines
888 B
C++
40 lines
888 B
C++
/*
|
|
* Copyright (C) 2025-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <seastar/core/gate.hh>
|
|
|
|
namespace compaction {
|
|
class compaction_manager;
|
|
class compaction_group_view;
|
|
class compaction_state;
|
|
|
|
class compaction_reenabler {
|
|
compaction_manager& _cm;
|
|
compaction::compaction_group_view* _table;
|
|
compaction::compaction_state& _compaction_state;
|
|
seastar::gate::holder _holder;
|
|
|
|
public:
|
|
compaction_reenabler(compaction_manager&, compaction::compaction_group_view&);
|
|
compaction_reenabler(compaction_reenabler&&) noexcept;
|
|
|
|
~compaction_reenabler();
|
|
|
|
compaction::compaction_group_view* compacting_table() const noexcept {
|
|
return _table;
|
|
}
|
|
|
|
const compaction::compaction_state& compaction_state() const noexcept {
|
|
return _compaction_state;
|
|
}
|
|
};
|
|
|
|
}
|