aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Storages/MergeTree/PinnedPartUUIDs.h
blob: a8f6c1fcedaf5c4cb2db7f50adefe8ebafb24ed3 (plain) (blame)
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
#pragma once

#include <Common/ZooKeeper/IKeeper.h>
#include <Core/UUID.h>
#include <set>

namespace DB
{

struct PinnedPartUUIDs
{
    std::set<UUID> part_uuids;
    Coordination::Stat stat{};

    bool contains(const UUID & part_uuid) const
    {
        return part_uuids.contains(part_uuid);
    }

    String toString() const;
    void fromString(const String & buf);

private:
    static constexpr auto JSON_KEY_UUIDS = "part_uuids";
};

}