forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
partition_based_splitting_writer.hh
35 lines (27 loc) · 1.16 KB
/
partition_based_splitting_writer.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Copyright (C) 2021-present ScyllaDB
*/
/*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#pragma once
#include <seastar/util/noncopyable_function.hh>
#include "feed_writers.hh"
namespace mutation_writer {
struct segregate_config {
// For flushing the memtable which does the in-memory segregation (sorting)
// part.
const io_priority_class& pc;
// Maximum amount of memory to be used by the in-memory segregation
// (sorting) structures. Partitions can be split across partitions
size_t max_memory;
};
// Given a producer that may contain partitions in the wrong order, or even
// contain partitions multiple times, separate them such that each output
// stream keeps the partition ordering guarantee. In other words, repair
// a stream that violates the ordering requirements by splitting it into output
// streams that honor it.
// This is useful for scrub compaction to split sstables containing out-of-order
// and/or duplicate partitions into sstables that honor the partition ordering.
future<> segregate_by_partition(flat_mutation_reader_v2 producer, segregate_config cfg, reader_consumer_v2 consumer);
} // namespace mutation_writer