ClickHouse/src/Storages/MergeTree/MergeMutateSelectedEntry.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.6 KiB
C++
Raw Normal View History

#pragma once
#include <Storages/MergeTree/FutureMergedMutatedPart.h>
#include <Storages/MutationCommands.h>
namespace DB
{
class StorageMergeTree;
struct StorageInMemoryMetadata;
using StorageMetadataPtr = std::shared_ptr<const StorageInMemoryMetadata>;
struct FutureMergedMutatedPart;
using FutureMergedMutatedPartPtr = std::shared_ptr<FutureMergedMutatedPart>;
struct CurrentlyMergingPartsTagger
{
FutureMergedMutatedPartPtr future_part;
ReservationSharedPtr reserved_space;
StorageMergeTree & storage;
// Optional tagger to maintain volatile parts for the JBOD balancer
std::optional<CurrentlySubmergingEmergingTagger> tagger;
CurrentlyMergingPartsTagger(
FutureMergedMutatedPartPtr future_part_,
size_t total_size,
StorageMergeTree & storage_,
const StorageMetadataPtr & metadata_snapshot,
bool is_mutation);
~CurrentlyMergingPartsTagger();
};
using CurrentlyMergingPartsTaggerPtr = std::unique_ptr<CurrentlyMergingPartsTagger>;
struct MergeMutateSelectedEntry
{
FutureMergedMutatedPartPtr future_part;
CurrentlyMergingPartsTaggerPtr tagger;
MutationCommandsConstPtr commands;
2021-12-14 20:06:34 +00:00
MergeTreeTransactionPtr txn;
MergeMutateSelectedEntry(FutureMergedMutatedPartPtr future_part_, CurrentlyMergingPartsTaggerPtr tagger_,
2022-03-16 19:16:26 +00:00
MutationCommandsConstPtr commands_, const MergeTreeTransactionPtr & txn_ = NO_TRANSACTION_PTR)
: future_part(future_part_)
, tagger(std::move(tagger_))
, commands(commands_)
2021-12-14 20:06:34 +00:00
, txn(txn_)
{}
};
using MergeMutateSelectedEntryPtr = std::shared_ptr<MergeMutateSelectedEntry>;
}