2015-06-24 11:03:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstddef>
|
2020-02-10 12:36:01 +00:00
|
|
|
#include <deque>
|
2021-12-09 10:39:28 +00:00
|
|
|
#include <set>
|
2015-06-24 11:03:53 +00:00
|
|
|
|
2021-12-09 10:39:28 +00:00
|
|
|
#include <IO/WriteBuffer.h>
|
2015-06-24 11:03:53 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2021-10-27 21:54:06 +00:00
|
|
|
/** A pair of marks that defines the range of rows in a part. Specifically,
|
|
|
|
* the range has the form [begin * index_granularity, end * index_granularity).
|
|
|
|
*/
|
2015-06-24 11:03:53 +00:00
|
|
|
struct MarkRange
|
|
|
|
{
|
2017-07-21 06:35:58 +00:00
|
|
|
size_t begin;
|
|
|
|
size_t end;
|
2015-06-24 11:03:53 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
MarkRange() = default;
|
2019-08-03 11:02:40 +00:00
|
|
|
MarkRange(const size_t begin_, const size_t end_) : begin{begin_}, end{end_} {}
|
2021-12-09 10:39:28 +00:00
|
|
|
|
|
|
|
bool operator==(const MarkRange & rhs) const;
|
|
|
|
|
|
|
|
bool operator<(const MarkRange & rhs) const;
|
2015-06-24 11:03:53 +00:00
|
|
|
};
|
|
|
|
|
2020-02-10 12:36:01 +00:00
|
|
|
using MarkRanges = std::deque<MarkRange>;
|
2015-06-24 11:03:53 +00:00
|
|
|
|
2021-10-27 21:54:06 +00:00
|
|
|
/** Get max range.end from ranges.
|
|
|
|
*/
|
|
|
|
size_t getLastMark(const MarkRanges & ranges);
|
2015-06-24 11:03:53 +00:00
|
|
|
|
|
|
|
}
|