Remove zookeeper support

This commit is contained in:
Matias Fontanini
2016-06-16 20:22:36 -07:00
parent e1c2ee34fe
commit 0fb0afc4f4
27 changed files with 42 additions and 800 deletions

View File

@@ -31,9 +31,6 @@
#include "exceptions.h"
#include "topic.h"
#include "topic_partition_list.h"
#ifdef CPPKAFKA_HAVE_ZOOKEEPER
#include "zookeeper/zookeeper_pool.h"
#endif // CPPKAFKA_HAVE_ZOOKEEPER
using std::string;
using std::vector;
@@ -126,32 +123,6 @@ const Configuration& KafkaHandleBase::get_configuration() const {
void KafkaHandleBase::set_handle(rd_kafka_t* handle) {
handle_ = HandlePtr(handle, &rd_kafka_destroy);
#ifdef CPPKAFKA_HAVE_ZOOKEEPER
if (config_.has_property("zookeeper")) {
string endpoint = config_.get("zookeeper");
milliseconds timeout = ZookeeperWatcher::DEFAULT_RECEIVE_TIMEOUT;
if (config_.has_property("zookeeper.receive.timeout.ms")) {
try {
timeout = milliseconds(stoi(config_.get("zookeeper.receive.timeout.ms")));
}
catch (exception&) {
throw ZookeeperException("Invalid zookeeper receive timeout");
}
}
auto& pool = ZookeeperPool::instance();
auto callback = [&](const string& brokers) {
// Add the brokers and poll
rd_kafka_brokers_add(handle_.get(), brokers.data());
rd_kafka_poll(handle_.get(), 10);
};
ZookeeperSubscription subscriber = pool.subscribe(endpoint, timeout, callback);
zookeeper_subscription_.reset(new ZookeeperSubscription(move(subscriber)));
callback(pool.get_brokers(endpoint));
}
#endif // CPPKAFKA_HAVE_ZOOKEEPER
}
Topic KafkaHandleBase::get_topic(const string& name, rd_kafka_topic_conf_t* conf) {