diff --git a/src/common/grpc/src/flight/do_put.rs b/src/common/grpc/src/flight/do_put.rs index 7997b7ba79..3898740afa 100644 --- a/src/common/grpc/src/flight/do_put.rs +++ b/src/common/grpc/src/flight/do_put.rs @@ -21,22 +21,40 @@ use crate::error::{Error, SerdeJsonSnafu}; /// The metadata for "DoPut" requests and responses. /// -/// Currently, there's only a "request_id", for coordinating requests and responses in the streams. +/// Currently, there's a "request_id", for coordinating requests and responses in the streams. /// Client can set a unique request id in this metadata, and the server will return the same id in /// the corresponding response. In doing so, a client can know how to do with its pending requests. #[derive(Serialize, Deserialize)] pub struct DoPutMetadata { request_id: i64, + /// Min timestamp of the batch (optional, for time-windowed batches) + #[serde(skip_serializing_if = "Option::is_none")] + min_timestamp: Option, + /// Max timestamp of the batch (optional, for time-windowed batches) + #[serde(skip_serializing_if = "Option::is_none")] + max_timestamp: Option, } impl DoPutMetadata { pub fn new(request_id: i64) -> Self { - Self { request_id } + Self { + request_id, + min_timestamp: None, + max_timestamp: None, + } } pub fn request_id(&self) -> i64 { self.request_id } + + pub fn min_timestamp(&self) -> Option { + self.min_timestamp + } + + pub fn max_timestamp(&self) -> Option { + self.max_timestamp + } } /// The response in the "DoPut" returned stream.