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.
72 lines
2.4 KiB
C++
72 lines
2.4 KiB
C++
/*
|
|
* This file is open source software, licensed to you under the terms
|
|
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
|
|
* distributed with this work for additional information regarding copyright
|
|
* ownership. You may not use this file except in compliance with the License.
|
|
*
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
* KIND, either express or implied. See the License for the
|
|
* specific language governing permissions and limitations
|
|
* under the License.
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2016-present ScyllaDB
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <seastar/core/seastar.hh>
|
|
|
|
#include "schema/schema.hh"
|
|
#include "schema/schema_builder.hh"
|
|
#include "db/row_cache.hh"
|
|
#include "replica/database.hh"
|
|
#include "replica/cell_locking.hh"
|
|
#include "compaction/compaction_manager.hh"
|
|
#include "compaction/compaction_group_view.hh"
|
|
#include "sstables/sstables_manager.hh"
|
|
|
|
struct table_for_tests {
|
|
class compaction_group_view;
|
|
struct data {
|
|
schema_ptr s;
|
|
replica::cf_stats cf_stats{0};
|
|
cell_locker_stats cl_stats;
|
|
lw_shared_ptr<replica::column_family> cf;
|
|
std::unique_ptr<compaction_group_view> table_s;
|
|
data_dictionary::storage_options storage;
|
|
data();
|
|
~data();
|
|
};
|
|
lw_shared_ptr<data> _data;
|
|
|
|
static schema_ptr make_default_schema();
|
|
|
|
explicit table_for_tests(sstables::sstables_manager& sstables_manager, compaction::compaction_manager& cm, schema_ptr s, replica::table::config cfg, data_dictionary::storage_options storage = {});
|
|
|
|
schema_ptr schema() { return _data->s; }
|
|
|
|
const replica::cf_stats& cf_stats() const noexcept { return _data->cf_stats; }
|
|
|
|
operator lw_shared_ptr<replica::column_family>() { return _data->cf; }
|
|
|
|
replica::column_family& operator*() { return *_data->cf; }
|
|
replica::column_family* operator->() { return _data->cf.get(); }
|
|
const replica::column_family* operator->() const { return _data->cf.get(); }
|
|
|
|
compaction::compaction_group_view& as_compaction_group_view() noexcept;
|
|
|
|
future<> stop();
|
|
|
|
void set_tombstone_gc_enabled(bool tombstone_gc_enabled) noexcept;
|
|
void set_repair_sstable_classifier(replica::repair_classifier_func repair_sstable_classifier);
|
|
};
|