mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 14:15:46 +00:00
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/
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2024-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <fmt/core.h>
|
|
|
|
struct compact_and_expire_result {
|
|
uint64_t live_cells = 0;
|
|
uint64_t dead_cells = 0;
|
|
uint32_t collection_tombstones = 0;
|
|
|
|
bool is_live() const noexcept {
|
|
return live_cells;
|
|
}
|
|
|
|
bool operator==(const compact_and_expire_result&) const = default;
|
|
|
|
compact_and_expire_result& operator+=(const compact_and_expire_result& o) {
|
|
live_cells += o.live_cells;
|
|
dead_cells += o.dead_cells;
|
|
collection_tombstones += o.collection_tombstones;
|
|
return *this;
|
|
}
|
|
};
|
|
|
|
template <> struct fmt::formatter<compact_and_expire_result> {
|
|
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
|
|
auto format(const compact_and_expire_result& r, fmt::format_context& ctx) const {
|
|
return fmt::format_to(ctx.out(), "{{live_cells: {}, dead_cells: {}, collection_tombstones: {}}}", r.live_cells, r.dead_cells,
|
|
r.collection_tombstones);
|
|
}
|
|
};
|