From f9b1b86554d1f46cbfff130357a9f073aca993c6 Mon Sep 17 00:00:00 2001 From: Yashash H L Date: Fri, 20 Dec 2024 09:19:12 +0530 Subject: [PATCH] remove with_value Signed-off-by: Yashash H L --- numaflow/src/batchmap.rs | 17 ----------------- numaflow/src/map.rs | 17 ----------------- numaflow/src/mapstream.rs | 19 +------------------ numaflow/src/reduce.rs | 17 ----------------- numaflow/src/sourcetransform.rs | 19 ------------------- 5 files changed, 1 insertion(+), 88 deletions(-) diff --git a/numaflow/src/batchmap.rs b/numaflow/src/batchmap.rs index 1237aa7..e5f43c7 100644 --- a/numaflow/src/batchmap.rs +++ b/numaflow/src/batchmap.rs @@ -196,23 +196,6 @@ impl Message { self.tags = Some(tags); self } - - /// Replaces the value of the message. - /// - /// # Arguments - /// - /// * `value` - A new vector of bytes that replaces the current message value. - /// - /// # Examples - /// - /// ``` - /// use numaflow::batchmap::Message; - /// let message = Message::new(vec![1, 2, 3]).with_value(vec![4, 5, 6]); - /// ``` - pub fn with_value(mut self, value: Vec) -> Self { - self.value = value; - self - } } /// The result of the call to [`BatchMapper::batchmap`] method. pub struct BatchResponse { diff --git a/numaflow/src/map.rs b/numaflow/src/map.rs index 9395311..89c70de 100644 --- a/numaflow/src/map.rs +++ b/numaflow/src/map.rs @@ -145,23 +145,6 @@ impl Message { self.tags = Some(tags); self } - - /// Replaces the value of the message. - /// - /// # Arguments - /// - /// * `value` - A new vector of bytes that replaces the current message value. - /// - /// # Examples - /// - /// ``` - /// use numaflow::map::Message; - /// let message = Message::new(vec![1, 2, 3]).with_value(vec![4, 5, 6]); - /// ``` - pub fn with_value(mut self, value: Vec) -> Self { - self.value = value; - self - } } impl From for proto::map_response::Result { diff --git a/numaflow/src/mapstream.rs b/numaflow/src/mapstream.rs index 094f2b5..8c4ade0 100644 --- a/numaflow/src/mapstream.rs +++ b/numaflow/src/mapstream.rs @@ -150,23 +150,6 @@ impl Message { self.tags = Some(tags); self } - - /// Replaces the value of the message. - /// - /// # Arguments - /// - /// * `value` - A new vector of bytes that replaces the current message value. - /// - /// # Examples - /// - /// ``` - /// use numaflow::mapstream::Message; - /// let message = Message::new(vec![1, 2, 3]).with_value(vec![4, 5, 6]); - /// ``` - pub fn with_value(mut self, value: Vec) -> Self { - self.value = value; - self - } } impl From for proto::map_response::Result { @@ -601,7 +584,7 @@ mod tests { async fn map_stream(&self, input: MapStreamRequest, tx: Sender) { let message = Message::new(input.value) .with_keys(input.keys) - .with_value(vec![]); + .with_tags(vec![]); tx.send(message).await.unwrap(); } } diff --git a/numaflow/src/reduce.rs b/numaflow/src/reduce.rs index 2de6d5e..1f27822 100644 --- a/numaflow/src/reduce.rs +++ b/numaflow/src/reduce.rs @@ -259,23 +259,6 @@ impl Message { self.tags = Some(tags); self } - - /// Replaces the value of the message. - /// - /// # Arguments - /// - /// * `value` - A new vector of bytes that replaces the current message value. - /// - /// # Examples - /// - /// ``` - /// use numaflow::reduce::Message; - /// let message = Message::new(vec![1, 2, 3]).with_value(vec![4, 5, 6]); - /// ``` - pub fn with_value(mut self, value: Vec) -> Self { - self.value = value; - self - } } /// Incoming request into the reducer handler of [`Reducer`]. diff --git a/numaflow/src/sourcetransform.rs b/numaflow/src/sourcetransform.rs index acf93e7..43475d6 100644 --- a/numaflow/src/sourcetransform.rs +++ b/numaflow/src/sourcetransform.rs @@ -171,25 +171,6 @@ impl Message { self.tags = Some(tags); self } - - /// Replaces the value of the message. - /// - /// # Arguments - /// - /// * `value` - A new vector of bytes that replaces the current message value. - /// - /// # Examples - /// - /// ``` - /// use numaflow::sourcetransform::Message; - /// use chrono::Utc; - /// let now = Utc::now(); - /// let message = Message::new(vec![1, 2, 3], now).with_value(vec![4, 5, 6]); - /// ``` - pub fn with_value(mut self, value: Vec) -> Self { - self.value = value; - self - } } /// Incoming request to the Source Transformer.