From 97385ca861482d3e2e16718169cf6b3f2b45231a Mon Sep 17 00:00:00 2001 From: Antonio Andelic Date: Mon, 26 Sep 2022 09:33:50 +0000 Subject: [PATCH] Format --- src/Interpreters/TransactionLog.cpp | 2 +- .../MergeTree/ReplicatedMergeTreeQueue.cpp | 20 ++++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Interpreters/TransactionLog.cpp b/src/Interpreters/TransactionLog.cpp index 1a584d3e171..83eda96c736 100644 --- a/src/Interpreters/TransactionLog.cpp +++ b/src/Interpreters/TransactionLog.cpp @@ -5,7 +5,7 @@ #include #include #include -#include "Common/ZooKeeper/Types.h" +#include #include #include #include diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp b/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp index 65c5121b67a..98eb775df4d 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp +++ b/src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp @@ -1951,6 +1951,7 @@ std::vector ReplicatedMergeTreeQueue::getMutationsStatu namespace { + struct BlockInfoInZooKeeper { String partition; @@ -1959,7 +1960,7 @@ struct BlockInfoInZooKeeper std::future contents_future; }; -template +template std::vector getBlockInfos(const auto & partitions, const auto & zookeeper, const auto & zookeeper_path) { using FutureListResponses = std::vector>; @@ -2000,8 +2001,7 @@ std::vector getBlockInfos(const auto & partitions, const a { Int64 block_number = parse(entry.substr(strlen("block-"))); String zk_path = fs::path(zookeeper_path) / "block_numbers" / partitions[i] / entry; - block_infos.emplace_back( - BlockInfoInZooKeeper{partitions[i], block_number, zk_path, zookeeper->asyncTryGet(zk_path)}); + block_infos.emplace_back(BlockInfoInZooKeeper{partitions[i], block_number, zk_path, zookeeper->asyncTryGet(zk_path)}); } } } @@ -2017,10 +2017,8 @@ ReplicatedMergeTreeQueue::QueueLocks ReplicatedMergeTreeQueue::lockQueue() return QueueLocks(state_mutex, pull_logs_to_queue_mutex, update_mutations_mutex); } -ReplicatedMergeTreeMergePredicate::ReplicatedMergeTreeMergePredicate( - ReplicatedMergeTreeQueue & queue_, zkutil::ZooKeeperPtr & zookeeper) - : queue(queue_) - , prev_virtual_parts(queue.format_version) +ReplicatedMergeTreeMergePredicate::ReplicatedMergeTreeMergePredicate(ReplicatedMergeTreeQueue & queue_, zkutil::ZooKeeperPtr & zookeeper) + : queue(queue_), prev_virtual_parts(queue.format_version) { { std::lock_guard lock(queue.state_mutex); @@ -2042,11 +2040,9 @@ ReplicatedMergeTreeMergePredicate::ReplicatedMergeTreeMergePredicate( { Strings partitions = zookeeper->getChildren(fs::path(queue.zookeeper_path) / "block_numbers"); - std::vector block_infos; - if (zookeeper->getApiVersion() >= KeeperApiVersion::WITH_MULTI_READ) - block_infos = getBlockInfos(partitions, zookeeper, queue.zookeeper_path); - else - block_infos = getBlockInfos(partitions, zookeeper, queue.zookeeper_path); + std::vector block_infos = zookeeper->getApiVersion() >= KeeperApiVersion::WITH_MULTI_READ + ? getBlockInfos(partitions, zookeeper, queue.zookeeper_path) + : getBlockInfos(partitions, zookeeper, queue.zookeeper_path); for (auto & block : block_infos) {