-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add Topic and Partition Deletion Functionality to Mock Broker #5350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ankith L (Ankith-Confluent)
wants to merge
3
commits into
dev_kip-932_queues-for-kafka
Choose a base branch
from
dev_kip-932_mock_broker_additional_functionalitles
base: dev_kip-932_queues-for-kafka
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+442
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -249,6 +249,47 @@ rd_kafka_mock_topic_create(rd_kafka_mock_cluster_t *mcluster, | |||||||||
| int replication_factor); | ||||||||||
|
|
||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @brief Deletes a topic and all its partitions. | ||||||||||
| * | ||||||||||
| * Subsequent requests referencing the topic will recieve | ||||||||||
| * UNKNOWN_TOPIC_OR_PARTITION. | ||||||||||
| * | ||||||||||
| * @param mcluster The mock cluster instance. | ||||||||||
| * @param topic The topic to delete. | ||||||||||
| * | ||||||||||
| * @return RD_KAFKA_RESP_ERR_NO_ERROR on success | ||||||||||
| * RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PARTITION if the topic does not | ||||||||||
|
Comment on lines
+261
to
+262
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| * exist. | ||||||||||
| */ | ||||||||||
| RD_EXPORT rd_kafka_resp_err_t | ||||||||||
| rd_kafka_mock_topic_delete(rd_kafka_mock_cluster_t *mcluster, | ||||||||||
| const char *topic); | ||||||||||
|
|
||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @brief Delete records before \p before_offset in \p topic [\p partition]. | ||||||||||
| * | ||||||||||
| * Advances the partition's start offset (log start offset) to | ||||||||||
| * \p before_offset and removes all message sets fully before that offset. | ||||||||||
| * | ||||||||||
| * @param mcluster The mock cluster. | ||||||||||
| * @param topic Topic name. | ||||||||||
| * @param partition Partition id. | ||||||||||
| * @param before_offset Delete all records before this offset. | ||||||||||
| * The new start offset will be set to this value. | ||||||||||
| * | ||||||||||
| * @returns RD_KAFKA_RESP_ERR_NO_ERROR on success, | ||||||||||
| * RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PART if partition doesn't exist, | ||||||||||
| * RD_KAFKA_RESP_ERR_OFFSET_OUT_OF_RANGE if before_offset > end_offset. | ||||||||||
| */ | ||||||||||
| RD_EXPORT rd_kafka_resp_err_t | ||||||||||
| rd_kafka_mock_partition_delete_records(rd_kafka_mock_cluster_t *mcluster, | ||||||||||
| const char *topic, | ||||||||||
| int32_t partition, | ||||||||||
| int64_t before_offset); | ||||||||||
|
|
||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @brief Sets the partition leader. | ||||||||||
| * | ||||||||||
|
|
@@ -647,6 +688,21 @@ RD_EXPORT void rd_kafka_mock_sharegroup_set_record_lock_duration( | |||||||||
| rd_kafka_mock_cluster_t *mcluster, | ||||||||||
| int lock_duration_ms); | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @brief Set the maximum number of members allowed in a share group. | ||||||||||
| * | ||||||||||
| * New members attempting to join via ShareGroupHeartbeat when the group | ||||||||||
| * is at capacity will receive GROUP_MAX_SIZE_REACHED. | ||||||||||
| * | ||||||||||
| * Default is 0 (unlimited). | ||||||||||
| * | ||||||||||
| * @param mcluster Mock cluster instance. | ||||||||||
| * @param max_size Maximum members allowed. 0 = unlimited. | ||||||||||
| */ | ||||||||||
| RD_EXPORT void | ||||||||||
| rd_kafka_mock_sharegroup_set_max_size(rd_kafka_mock_cluster_t *mcluster, | ||||||||||
| int max_size); | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @brief Set a manual target assignment for a sharegroup. | ||||||||||
| * | ||||||||||
|
|
||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: receive