mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
Add support for simple list
This commit is contained in:
parent
f833366555
commit
937d534cd4
@ -36,4 +36,5 @@ Coordination::RequestPtr makeCheckRequest(const std::string & path, int version)
|
||||
|
||||
Coordination::RequestPtr makeGetRequest(const std::string & path);
|
||||
Coordination::RequestPtr makeListRequest(const std::string & path);
|
||||
Coordination::RequestPtr makeSimpleListRequest(const std::string & path);
|
||||
}
|
||||
|
@ -1222,6 +1222,13 @@ Coordination::RequestPtr makeListRequest(const std::string & path)
|
||||
return request;
|
||||
}
|
||||
|
||||
Coordination::RequestPtr makeSimpleListRequest(const std::string & path)
|
||||
{
|
||||
auto request = std::make_shared<Coordination::ZooKeeperSimpleListRequest>();
|
||||
request->path = path;
|
||||
return request;
|
||||
}
|
||||
|
||||
std::string normalizeZooKeeperPath(std::string zookeeper_path, bool check_starts_with_slash, Poco::Logger * log)
|
||||
{
|
||||
if (!zookeeper_path.empty() && zookeeper_path.back() == '/')
|
||||
|
@ -485,6 +485,11 @@ ZooKeeperMultiRequest::ZooKeeperMultiRequest(const Requests & generic_requests,
|
||||
checkOperationType(Read);
|
||||
requests.push_back(std::make_shared<ZooKeeperGetRequest>(*concrete_request_get));
|
||||
}
|
||||
else if (const auto * concrete_request_simple_list = dynamic_cast<const ZooKeeperSimpleListRequest *>(generic_request.get()))
|
||||
{
|
||||
checkOperationType(Read);
|
||||
requests.push_back(std::make_shared<ZooKeeperSimpleListRequest>(*concrete_request_simple_list));
|
||||
}
|
||||
else if (const auto * concrete_request_list = dynamic_cast<const ListRequest *>(generic_request.get()))
|
||||
{
|
||||
checkOperationType(Read);
|
||||
|
@ -351,9 +351,6 @@ struct ZooKeeperListRequest : ListRequest, ZooKeeperRequest
|
||||
|
||||
struct ZooKeeperSimpleListRequest final : ZooKeeperListRequest
|
||||
{
|
||||
ZooKeeperSimpleListRequest() = default;
|
||||
explicit ZooKeeperSimpleListRequest(const ListRequest & base) : ZooKeeperListRequest(base) {}
|
||||
|
||||
OpNum getOpNum() const override { return OpNum::SimpleList; }
|
||||
ZooKeeperResponsePtr makeResponse() const override;
|
||||
};
|
||||
|
@ -1655,6 +1655,10 @@ struct KeeperStorageMultiRequestProcessor final : public KeeperStorageRequestPro
|
||||
check_operation_type(OperationType::Read);
|
||||
concrete_requests.push_back(std::make_shared<KeeperStorageListRequestProcessor>(sub_zk_request));
|
||||
break;
|
||||
case Coordination::OpNum::SimpleList:
|
||||
check_operation_type(OperationType::Read);
|
||||
concrete_requests.push_back(std::make_shared<KeeperStorageListRequestProcessor>(sub_zk_request));
|
||||
break;
|
||||
default:
|
||||
throw DB::Exception(
|
||||
ErrorCodes::BAD_ARGUMENTS, "Illegal command as part of multi ZooKeeper request {}", sub_zk_request->getOpNum());
|
||||
|
Loading…
Reference in New Issue
Block a user