Files
scylladb/db/hints/sync_point.hh
Avi Kivity fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00

44 lines
1.1 KiB
C++

/*
* Copyright (C) 2021-present ScyllaDB
*/
/*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#pragma once
#include <cstdint>
#include <string_view>
#include <unordered_map>
#include <vector>
#include <seastar/core/sstring.hh>
#include "gms/inet_address.hh"
#include "db/commitlog/replay_position.hh"
namespace db {
namespace hints {
// A sync point is a collection of positions in hint queues which can be waited on.
// The sync point encompasses one type of hints manager only.
struct sync_point {
using shard_rps = std::unordered_map<gms::inet_address, db::replay_position>;
// ID of the host which created this sync point
utils::UUID host_id;
std::vector<shard_rps> regular_per_shard_rps;
std::vector<shard_rps> mv_per_shard_rps;
/// \brief Decodes a sync point from an encoded, textual form (a hexadecimal string).
static sync_point decode(sstring_view s);
/// \brief Encodes the sync point in a textual form (a hexadecimal string)
sstring encode() const;
bool operator==(const sync_point& other) const = default;
};
std::ostream& operator<<(std::ostream& out, const sync_point& sp);
}
}