mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #58092 from Algunenano/cosmetic_changes
Minor cosmetic changes
This commit is contained in:
commit
b57bc0e4ed
@ -78,13 +78,16 @@ BackupInfo BackupInfo::fromAST(const IAST & ast)
|
||||
}
|
||||
}
|
||||
|
||||
res.args.reserve(list->children.size() - index);
|
||||
for (; index < list->children.size(); ++index)
|
||||
size_t args_size = list->children.size();
|
||||
res.args.reserve(args_size - index);
|
||||
for (; index < args_size; ++index)
|
||||
{
|
||||
const auto & elem = list->children[index];
|
||||
const auto * lit = elem->as<const ASTLiteral>();
|
||||
if (!lit)
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected literal, got {}", serializeAST(*elem));
|
||||
}
|
||||
res.args.push_back(lit->value);
|
||||
}
|
||||
}
|
||||
|
@ -290,6 +290,11 @@ bool ZooKeeperWithFaultInjection::exists(const std::string & path, Coordination:
|
||||
return executeWithFaultSync(__func__, path, [&]() { return keeper->exists(path, stat, watch); });
|
||||
}
|
||||
|
||||
bool ZooKeeperWithFaultInjection::anyExists(const std::vector<std::string> & paths)
|
||||
{
|
||||
return executeWithFaultSync(__func__, !paths.empty() ? paths.front() : "", [&]() { return keeper->anyExists(paths); });
|
||||
}
|
||||
|
||||
zkutil::ZooKeeper::MultiExistsResponse ZooKeeperWithFaultInjection::exists(const std::vector<std::string> & paths)
|
||||
{
|
||||
return executeWithFaultSync(__func__, !paths.empty() ? paths.front() : "", [&]() { return keeper->exists(paths); });
|
||||
|
@ -59,6 +59,7 @@ private:
|
||||
class ZooKeeperWithFaultInjection
|
||||
{
|
||||
zkutil::ZooKeeper::Ptr keeper;
|
||||
|
||||
std::unique_ptr<RandomFaultInjection> fault_policy;
|
||||
std::string name;
|
||||
Poco::Logger * logger = nullptr;
|
||||
@ -203,6 +204,8 @@ public:
|
||||
|
||||
zkutil::ZooKeeper::MultiExistsResponse exists(const std::vector<std::string> & paths);
|
||||
|
||||
bool anyExists(const std::vector<std::string> & paths);
|
||||
|
||||
std::string create(const std::string & path, const std::string & data, int32_t mode);
|
||||
|
||||
Coordination::Error tryCreate(const std::string & path, const std::string & data, int32_t mode, std::string & path_created);
|
||||
|
Loading…
Reference in New Issue
Block a user