Skip to content

Commit 5916b51

Browse files
authored
chore: add timestamp range to flight meta (#7513)
* feat(flight): add timestamp range to DoPutMetadata Add optional start_timestamp and end_timestamp fields to DoPutMetadata to support time-windowed batch operations in the Flight DoPut API. Signed-off-by: Lei, HUANG <[email protected]> * fix: docs Signed-off-by: Lei, HUANG <[email protected]> --------- Signed-off-by: Lei, HUANG <[email protected]>
1 parent c34d142 commit 5916b51

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/common/grpc/src/flight/do_put.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,40 @@ use crate::error::{Error, SerdeJsonSnafu};
2121

2222
/// The metadata for "DoPut" requests and responses.
2323
///
24-
/// Currently, there's only a "request_id", for coordinating requests and responses in the streams.
24+
/// Currently, there's a "request_id", for coordinating requests and responses in the streams.
2525
/// Client can set a unique request id in this metadata, and the server will return the same id in
2626
/// the corresponding response. In doing so, a client can know how to do with its pending requests.
2727
#[derive(Serialize, Deserialize)]
2828
pub struct DoPutMetadata {
2929
request_id: i64,
30+
/// Min timestamp of the batch (optional, for time-windowed batches)
31+
#[serde(skip_serializing_if = "Option::is_none")]
32+
min_timestamp: Option<i64>,
33+
/// Max timestamp of the batch (optional, for time-windowed batches)
34+
#[serde(skip_serializing_if = "Option::is_none")]
35+
max_timestamp: Option<i64>,
3036
}
3137

3238
impl DoPutMetadata {
3339
pub fn new(request_id: i64) -> Self {
34-
Self { request_id }
40+
Self {
41+
request_id,
42+
min_timestamp: None,
43+
max_timestamp: None,
44+
}
3545
}
3646

3747
pub fn request_id(&self) -> i64 {
3848
self.request_id
3949
}
50+
51+
pub fn min_timestamp(&self) -> Option<i64> {
52+
self.min_timestamp
53+
}
54+
55+
pub fn max_timestamp(&self) -> Option<i64> {
56+
self.max_timestamp
57+
}
4058
}
4159

4260
/// The response in the "DoPut" returned stream.

0 commit comments

Comments
 (0)