spetz commented on code in PR #1624:
URL: https://github.com/apache/iggy/pull/1624#discussion_r1986872927
##########
sdk/src/segments/delete_segments.rs:
##########
@@ -0,0 +1,182 @@
+use crate::bytes_serializable::BytesSerializable;
+use crate::command::{Command, DELETE_SEGMENTS_CODE};
+use crate::error::IggyError;
+use crate::identifier::Identifier;
+use crate::utils::sizeable::Sizeable;
+use crate::validatable::Validatable;
+use bytes::{BufMut, Bytes, BytesMut};
+use serde::{Deserialize, Serialize};
+use std::fmt::Display;
+
+use super::MAX_SEGMENTS_COUNT;
+
+type SegmentsCountType = u32;
+
+/// `DeleteSegments` command is used to delete segments from a partition.
+/// It has additional payload:
+/// - `stream_id` - unique stream ID (numeric or name).
+/// - `topic_id` - unique topic ID (numeric or name).
+/// - `partition_id` - unique partition ID (numeric or name).
+/// - `segments_count` - number of segments in the partition to delete, max
value is defined in MAX_SEGMENTS_COUNT.
+#[derive(Debug, Serialize, Deserialize, PartialEq)]
+pub struct DeleteSegments {
+ /// Unique stream ID (numeric or name).
+ #[serde(skip)]
+ pub stream_id: Identifier,
+ /// Unique topic ID (numeric or name).
+ #[serde(skip)]
+ pub topic_id: Identifier,
+ /// Unique partition ID (numeric or name).
+ #[serde(skip)]
+ pub partition_id: Identifier,
+ /// Number of segments in the topic to delete, max value is 1000.
Review Comment:
`segments in the partition`, not the topic :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]