|
28 | 28 | #ifndef _RDKAFKA_SHARE_ACKNOWLEDGEMENT_H_ |
29 | 29 | #define _RDKAFKA_SHARE_ACKNOWLEDGEMENT_H_ |
30 | 30 |
|
31 | | -#include "rdlist.h" |
32 | | -#include "rdkafka.h" |
33 | | - |
34 | | -/* Forward declarations */ |
35 | 31 | typedef struct rd_kafka_op_s rd_kafka_op_t; |
36 | 32 |
|
37 | 33 | typedef enum rd_kafka_internal_ShareAcknowledgement_type_s { |
@@ -250,39 +246,6 @@ struct rd_kafka_share_partition_offsets_list_s { |
250 | 246 | offsets */ |
251 | 247 | }; |
252 | 248 |
|
253 | | -/** |
254 | | - * @brief Allocate and initialize a partition offsets element. |
255 | | - * |
256 | | - * @param topic_id Topic UUID. |
257 | | - * @param topic Topic name (will be duplicated). |
258 | | - * @param partition Partition id. |
259 | | - * @param offsets_cnt Number of offsets to allocate space for. |
260 | | - * @returns Newly allocated partition offsets element. |
261 | | - */ |
262 | | -rd_kafka_share_partition_offsets_t * |
263 | | -rd_kafka_share_partition_offsets_new(rd_kafka_Uuid_t topic_id, |
264 | | - const char *topic, |
265 | | - int32_t partition, |
266 | | - int offsets_cnt); |
267 | | - |
268 | | -/** |
269 | | - * @brief Destroy a partition offsets element. |
270 | | - * |
271 | | - * @param elem Element to destroy. |
272 | | - */ |
273 | | -void rd_kafka_share_partition_offsets_destroy( |
274 | | - rd_kafka_share_partition_offsets_t *elem); |
275 | | - |
276 | | -/** |
277 | | - * @brief Allocate and initialize a partition offsets list. |
278 | | - * |
279 | | - * @param capacity Initial capacity for elements. |
280 | | - * @returns Newly allocated list, or NULL if capacity is 0. |
281 | | - * Caller must destroy with |
282 | | - * rd_kafka_share_partition_offsets_list_destroy(). |
283 | | - */ |
284 | | -rd_kafka_share_partition_offsets_list_t * |
285 | | -rd_kafka_share_partition_offsets_list_new(int capacity); |
286 | 249 |
|
287 | 250 | /** |
288 | 251 | * @brief Destroy a partition offsets list. |
@@ -320,21 +283,28 @@ rd_kafka_share_build_partition_offsets_list( |
320 | 283 | * @param batches The ack batches for this partition (contains offsets). |
321 | 284 | * @param err Error code to report in callback. |
322 | 285 | */ |
323 | | -void rd_kafka_share_enqueue_ack_callback(rd_kafka_t *rk, |
324 | | - rd_kafka_share_ack_batches_t *batches, |
325 | | - rd_kafka_resp_err_t err); |
| 286 | +void rd_kafka_share_enqueue_ack_commit_cb_op( |
| 287 | + rd_kafka_t *rk, |
| 288 | + rd_kafka_share_ack_batches_t *batches, |
| 289 | + rd_kafka_resp_err_t err); |
326 | 290 |
|
327 | 291 |
|
328 | 292 | /** |
329 | | - * @brief Dispatch ack callbacks for all partitions in ack_details. |
| 293 | + * @brief Enqueue acknowledgement callbacks to application for each partition. |
| 294 | + * |
| 295 | + * Iterates through each partition in ack_details and enqueues one callback |
| 296 | + * operation (RD_KAFKA_OP_SHARE_ACK_COMMIT_CB) per partition to the |
| 297 | + * application's reply queue. Each operation contains: |
| 298 | + * - The partition's acknowledged offsets |
| 299 | + * - Per-partition error code from batch->rktpar->err |
330 | 300 | * |
331 | | - * If err is set (top-level error), all partitions receive the same error. |
332 | | - * Otherwise, per-partition results from ack_results are used. |
| 301 | + * The application's share_acknowledgement_commit_cb is invoked once per |
| 302 | + * partition when the app calls rd_kafka_consumer_poll() or |
| 303 | + * rd_kafka_queue_poll(). |
333 | 304 | * |
334 | 305 | * @param rk Kafka handle. |
335 | | - * @param ack_details List of ack batches. |
336 | | - * @param ack_results Per-partition results (may be NULL). |
337 | | - * @param err Top-level error code. |
| 306 | + * @param ack_details List of rd_kafka_share_ack_batches_t* with acknowledgement |
| 307 | + * results and per-partition error codes. |
338 | 308 | */ |
339 | 309 | void rd_kafka_share_dispatch_ack_callbacks(rd_kafka_t *rk, |
340 | 310 | rd_list_t *ack_details); |
|
0 commit comments