2014-03-07 13:50:58 +00:00
|
|
|
#pragma once
|
2016-01-11 21:46:36 +00:00
|
|
|
|
2018-08-25 01:58:14 +00:00
|
|
|
#include <Common/ZooKeeper/Types.h>
|
2016-10-24 02:02:37 +00:00
|
|
|
|
2014-03-07 13:50:58 +00:00
|
|
|
|
|
|
|
namespace zkutil
|
|
|
|
{
|
|
|
|
|
2017-10-03 14:44:10 +00:00
|
|
|
|
2018-08-25 01:58:14 +00:00
|
|
|
using KeeperException = Coordination::Exception;
|
2014-03-07 13:50:58 +00:00
|
|
|
|
2018-03-13 20:36:22 +00:00
|
|
|
|
|
|
|
class KeeperMultiException : public KeeperException
|
|
|
|
{
|
|
|
|
public:
|
2018-08-25 01:58:14 +00:00
|
|
|
Coordination::Requests requests;
|
|
|
|
Coordination::Responses responses;
|
2018-03-24 20:00:16 +00:00
|
|
|
size_t failed_op_index = 0;
|
|
|
|
|
|
|
|
std::string getPathForFirstFailedOp() const;
|
2018-03-13 20:36:22 +00:00
|
|
|
|
|
|
|
/// If it is user error throws KeeperMultiException else throws ordinary KeeperException
|
|
|
|
/// If it is ZOK does nothing
|
2020-06-12 15:09:12 +00:00
|
|
|
static void check(Coordination::Error code, const Coordination::Requests & requests, const Coordination::Responses & responses);
|
2018-03-13 20:36:22 +00:00
|
|
|
|
2020-06-12 15:09:12 +00:00
|
|
|
KeeperMultiException(Coordination::Error code, const Coordination::Requests & requests, const Coordination::Responses & responses);
|
2018-03-25 00:56:08 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-12 15:09:12 +00:00
|
|
|
static size_t getFailedOpIndex(Coordination::Error code, const Coordination::Responses & responses);
|
2018-03-13 20:36:22 +00:00
|
|
|
};
|
|
|
|
|
2018-08-10 04:02:56 +00:00
|
|
|
}
|