Skip to content

Commit 4a3ec91

Browse files
authored
Merge pull request mfontanini#215 from accelerated/partition
Added method to set the partition
2 parents a357529 + a85a87b commit 4a3ec91

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/cppkafka/topic_partition.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ class CPPKAFKA_API TopicPartition {
106106
* Gets the offset
107107
*/
108108
int64_t get_offset() const;
109+
110+
/**
111+
* @brief Sets the partition
112+
*/
113+
void set_partition(int partition);
109114

110115
/**
111116
* Sets the offset

src/topic_partition.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ int64_t TopicPartition::get_offset() const {
7676
return offset_;
7777
}
7878

79+
void TopicPartition::set_partition(int partition) {
80+
partition_ = partition;
81+
}
82+
7983
void TopicPartition::set_offset(int64_t offset) {
8084
offset_ = offset;
8185
}

0 commit comments

Comments
 (0)