MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / flushMulti

Function flushMulti

programs/keeper-bench/Runner.cpp:1442–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1440{
1441
1442void flushMulti(Coordination::ZooKeeper & zookeeper, Coordination::Requests & batch)
1443{
1444 if (batch.empty())
1445 return;
1446
1447 auto promise = std::make_shared<std::promise<Coordination::MultiResponse>>();
1448 auto future = promise->get_future();
1449 zookeeper.multi(batch, [promise](const Coordination::MultiResponse & response)
1450 {
1451 promise->set_value(response);
1452 });
1453 auto response = future.get();
1454 if (response.error != Coordination::Error::ZOK)
1455 throw zkutil::KeeperException(response.error, "Multi request failed");
1456
1457 batch.clear();
1458}
1459
1460void addToBatchAndMaybeFlush(Coordination::ZooKeeper & zookeeper, Coordination::Requests & batch, Coordination::RequestPtr request)
1461{

Callers 3

addToBatchAndMaybeFlushFunction · 0.85
removeRecursiveFunction · 0.85
startupMethod · 0.85

Calls 6

KeeperExceptionClass · 0.85
set_valueMethod · 0.80
emptyMethod · 0.45
multiMethod · 0.45
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected