Files
scylla/mutation_writer/token_group_based_splitting_writer.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

29 lines
931 B
C++

/*
* Copyright (C) 2023-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include <functional>
#include "readers/mutation_reader.hh"
#include "dht/token.hh"
namespace mutation_writer {
using token_group_id = size_t;
using classify_by_token_group = std::function<token_group_id(dht::token)>;
// This segregation mechanism work with the concept of token groups, where
// different groups don't overlap each other in their token range, and also
// group 0 always precedes group 1 in the token order.
// Therefore, it's guaranteed that the segregator will emit data for only
// one group at a time. When moving to the next group, we're guaranteed
// that producer won't longer emit data for the previous group.
future<> segregate_by_token_group(mutation_reader producer, classify_by_token_group classify, reader_consumer_v2 consumer);
} // namespace mutation_writer