Skip to content
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

Add delete_groups API to AdminClient. (no-op in simulation) #235

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions madsim-rdkafka/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.3] - 2025-01-09

### Changed

- Add `delete_groups` API to `AdminClient`. (no-op in simulation)

## [0.4.2] - 2024-05-13

### Changed
Expand Down
2 changes: 1 addition & 1 deletion madsim-rdkafka/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "madsim-rdkafka"
version = "0.4.2+0.34.0"
version = "0.4.3+0.34.0"
edition = "2021"
authors = ["Runji Wang <wangrunji0408@163.com>"]
description = "The rdkafka simulator on madsim."
Expand Down
14 changes: 14 additions & 0 deletions madsim-rdkafka/src/sim/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use std::future::Future;
use std::net::SocketAddr;

use madsim::net::Endpoint;
Expand Down Expand Up @@ -99,6 +100,16 @@ where
}
Ok(results)
}

/// Deletes the named groups.
pub fn delete_groups(
&self,
_group_names: &[&str],
_opts: &AdminOptions,
) -> impl Future<Output = KafkaResult<Vec<GroupResult>>> {
// no-op
std::future::ready(Ok(vec![]))
}
}

/// Options for an admin API request.
Expand Down Expand Up @@ -229,6 +240,9 @@ pub enum TopicReplication<'a> {
/// CreatePartition operation.
pub type TopicResult = Result<String, (String, RDKafkaErrorCode)>;

/// The result of a DeleteGroup operation.
pub type GroupResult = Result<String, (String, RDKafkaErrorCode)>;

/// AdminClient configs.
///
/// <https://kafka.apache.org/documentation/#adminclientconfigs>
Expand Down
2 changes: 1 addition & 1 deletion madsim-rdkafka/src/std/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ impl<'a> NewPartitions<'a> {

/// Sets the partition replica assignment for the new partitions. Only
/// assignments for newly created replicas should be included.
pub fn assign(mut self, assignment: PartitionAssignment<'a>) -> NewPartitions<'_> {
pub fn assign(mut self, assignment: PartitionAssignment<'a>) -> NewPartitions<'a> {
self.assignment = Some(assignment);
self
}
Expand Down
Loading