Files
scylladb/compaction/compaction_weight_registration.hh
Botond Dénes 86ed627fc4 compaction: move code to namespace compaction
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.
2025-09-25 15:03:56 +03:00

38 lines
873 B
C++

/*
* Copyright (C) 2017-present ScyllaDB
*
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
namespace compaction {
class compaction_manager;
class compaction_weight_registration {
compaction_manager* _cm;
int _weight;
public:
compaction_weight_registration(compaction_manager* cm, int weight);
compaction_weight_registration& operator=(const compaction_weight_registration&) = delete;
compaction_weight_registration(const compaction_weight_registration&) = delete;
compaction_weight_registration& operator=(compaction_weight_registration&& other) noexcept;
compaction_weight_registration(compaction_weight_registration&& other) noexcept;
~compaction_weight_registration();
// Release immediately the weight hold by this object
void deregister();
int weight() const;
};
}