Skip to content

Commit

Permalink
Fix warning and add rack to cluster nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
milindl committed Sep 21, 2023
1 parent fd14d24 commit 74d98dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/describe_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ print_cluster_info(const rd_kafka_DescribeCluster_result_t *clusterdesc) {
const rd_kafka_Node_t *node = nodes[j];
printf("Node [id: %" PRId32
", host: %s"
", port: %" PRIu16 "]\n",
", port: %" PRIu16 ", rack: %s]\n",
rd_kafka_Node_id(node), rd_kafka_Node_host(node),
rd_kafka_Node_port(node));
rd_kafka_Node_port(node), rd_kafka_Node_rack(node));
}
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions src/rdkafka_admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -8410,9 +8410,9 @@ rd_kafka_ClusterDescription_new(const rd_kafka_metadata_internal_t *mdi) {
rd_calloc(clusterdesc->node_cnt, sizeof(rd_kafka_Node_t *));

for (i = 0; i < md->broker_cnt; i++)
clusterdesc->nodes[i] =
rd_kafka_Node_new(md->brokers[i].id, md->brokers[i].host,
md->brokers[i].port, NULL);
clusterdesc->nodes[i] = rd_kafka_Node_new_from_brokers(
md->brokers[i].id, mdi->brokers_sorted, mdi->brokers,
md->broker_cnt);

return clusterdesc;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rdkafka_aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ typedef struct rd_kafka_Node_s {
int id; /*< Node id */
char *host; /*< Node host */
uint16_t port; /*< Node port */
char *rack /*< (optional) Node rack id */
char *rack; /*< (optional) Node rack id */
} rd_kafka_Node_t;

rd_kafka_Node_t *rd_kafka_Node_new(int32_t id,
Expand Down

0 comments on commit 74d98dc

Please sign in to comment.