Java SDK: expose deleteSegments

Open
#4,369 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@AmalenduManoj is already working on this.

Since Oct 2, 2026.

  • #4381 by @AmalenduManoj — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
75/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
java, rust

Research direction

Start with serde/CommandCode.java, VsrOperation.java, the blocking and async PartitionsClient interfaces, and the TCP and HTTP client files listed in the issue; compare their existing deletePartitions implementations. Check the payload format in core/binary_protocol/src/requests/segments/delete_segments.rs, then add the case to PartitionsClientBaseTest.java. Done means the new test passes for both TCP and HTTP clients.

Written by the indexing model from the issue text.

Description

good first issue java

The Rust client has SegmentClient::delete_segments (core/common/src/traits/segment_client.rs). The Java SDK has no method for it.

What to do

  • Add a Segment enum with DELETE(503) to serde/CommandCode.java. The VSR operation is already mapped in VsrOperation.java.
  • Add deleteSegments(StreamId streamId, TopicId topicId, Long partitionId, Long segmentsCount) to the blocking and async PartitionsClient interfaces, next to deletePartitions.
  • Implement it in the TCP clients (client/async/tcp/PartitionsTcpClient.java, client/blocking/tcp/PartitionsTcpClient.java), following deletePartitions. The payload is the stream identifier, the topic identifier, then the partition ID and the segments count as little-endian u32 values (core/binary_protocol/src/requests/segments/delete_segments.rs).
  • Implement it in the HTTP client (client/blocking/http/PartitionsHttpClient.java): DELETE /streams/{stream_id}/topics/{topic_id}/partitions/{partition_id} with a segments_count query parameter.
  • Add a test to PartitionsClientBaseTest.java. The base test runs for both TCP and HTTP.

Done when

The new test passes for both the TCP and HTTP clients.

Dominant language
Rust
Stars
5.3k
Forks
548
Avg merge
2d 20h
Merged PRs (30d)
194

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iggy

All issues in apache/iggy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.