Replace TopicPartitionList class with a vector of TopicPartition

This commit is contained in:
Matias Fontanini
2016-05-28 09:02:44 -07:00
parent c31d00115a
commit 5b957de7e4
10 changed files with 106 additions and 171 deletions

View File

@@ -2,8 +2,10 @@
#include "exceptions.h"
#include "topic_configuration.h"
#include "topic.h"
#include "topic_partition_list.h"
using std::string;
using std::vector;
using std::chrono::milliseconds;
namespace cppkafka {
@@ -21,14 +23,16 @@ KafkaHandleBase::KafkaHandleBase(rd_kafka_t* handle)
}
void KafkaHandleBase::pause_partitions(const TopicPartitionList& topic_partitions) {
TopicPartitionsListPtr topic_list_handle = convert(topic_partitions);
rd_kafka_resp_err_t error = rd_kafka_pause_partitions(get_handle(),
topic_partitions.get_handle());
topic_list_handle.get());
check_error(error);
}
void KafkaHandleBase::resume_partitions(const TopicPartitionList& topic_partitions) {
TopicPartitionsListPtr topic_list_handle = convert(topic_partitions);
rd_kafka_resp_err_t error = rd_kafka_resume_partitions(get_handle(),
topic_partitions.get_handle());
topic_list_handle.get());
check_error(error);
}