Files
scylladb/tombstone_gc_options.hh
Avi Kivity f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00

37 lines
1.1 KiB
C++

/*
* Copyright (C) 2021-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include <map>
#include <chrono>
#include <fmt/core.h>
#include <seastar/core/sstring.hh>
enum class tombstone_gc_mode : uint8_t { timeout, disabled, immediate, repair };
class tombstone_gc_options {
private:
tombstone_gc_mode _mode = tombstone_gc_mode::timeout;
std::chrono::seconds _propagation_delay_in_seconds = std::chrono::seconds(3600);
public:
tombstone_gc_options() = default;
const tombstone_gc_mode& mode() const { return _mode; }
explicit tombstone_gc_options(const std::map<seastar::sstring, seastar::sstring>& map);
const std::chrono::seconds& propagation_delay_in_seconds() const {
return _propagation_delay_in_seconds;
}
std::map<seastar::sstring, seastar::sstring> to_map() const;
seastar::sstring to_sstring() const;
bool operator==(const tombstone_gc_options&) const = default;
};
template <> struct fmt::formatter<tombstone_gc_mode> : fmt::formatter<string_view> {
auto format(tombstone_gc_mode mode, fmt::format_context& ctx) const -> decltype(ctx.out());
};