Using different ZooKeeper library (development) [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-03-25 02:13:05 +03:00
parent 280a5f8e3f
commit 0714a217fe
2 changed files with 8 additions and 6 deletions

View File

@ -11,7 +11,7 @@
#include <array> #include <array>
#include <iostream> //#include <iostream>
/** ZooKeeper wire protocol. /** ZooKeeper wire protocol.
@ -799,7 +799,7 @@ void ZooKeeper::receiveEvent()
response = std::make_shared<HeartbeatResponse>(); response = std::make_shared<HeartbeatResponse>();
std::cerr << "Received heartbeat\n"; // std::cerr << "Received heartbeat\n";
} }
else if (xid == watch_xid) else if (xid == watch_xid)
{ {
@ -833,7 +833,7 @@ void ZooKeeper::receiveEvent()
} }
}; };
std::cerr << "Received watch\n"; // std::cerr << "Received watch\n";
} }
else else
{ {
@ -848,7 +848,7 @@ void ZooKeeper::receiveEvent()
operations.erase(it); operations.erase(it);
} }
std::cerr << "Received response: " << request_info.request->getOpNum() << "\n"; // std::cerr << "Received response: " << request_info.request->getOpNum() << "\n";
response = request_info.request->makeResponse(); response = request_info.request->makeResponse();
} }
@ -1083,7 +1083,7 @@ void ZooKeeper::MultiResponse::readImpl(ReadBuffer & in)
ZooKeeperImpl::read(done, in); ZooKeeperImpl::read(done, in);
ZooKeeperImpl::read(op_error, in); ZooKeeperImpl::read(op_error, in);
std::cerr << "Received result for multi: " << op_num << "\n"; // std::cerr << "Received result for multi: " << op_num << "\n";
if (done) if (done)
throw Exception("Not enough results received for multi transaction"); throw Exception("Not enough results received for multi transaction");

View File

@ -1,7 +1,9 @@
#include <Common/ZooKeeper/ZooKeeper.h> #include <Common/ZooKeeper/ZooKeeper.h>
#include <Common/typeid_cast.h>
#include <iostream> #include <iostream>
#include <port/unistd.h> #include <port/unistd.h>
using namespace zkutil; using namespace zkutil;
int main(int argc, char ** argv) int main(int argc, char ** argv)
@ -41,7 +43,7 @@ try
ops.emplace_back(zkutil::makeRemoveRequest("/test", -1)); ops.emplace_back(zkutil::makeRemoveRequest("/test", -1));
std::cout << "multi" << std::endl; std::cout << "multi" << std::endl;
zkutil::Responses res = zk.multi(ops); zkutil::Responses res = zk.multi(ops);
std::cout << "path created: " << dynamic_cast<ZooKeeperImpl::ZooKeeper::CreateResponse &>(*ops[0]).path_created << std::endl; std::cout << "path created: " << typeid_cast<const CreateResponse &>(*res[0]).path_created << std::endl;
return 0; return 0;
} }