tustvold commented on code in PR #817:
URL:
https://github.com/apache/arrow-rs-object-store/pull/817#discussion_r3839991833
##########
src/client/http/body.rs:
##########
@@ -102,14 +118,41 @@ impl From<String> for HttpRequestBody {
impl From<PutPayload> for HttpRequestBody {
fn from(value: PutPayload) -> Self {
- Self(Inner::PutPayload(0, value))
+ match value.is_streaming() {
+ false => Self(Inner::PutPayload(0, value)),
+ true => Self(Inner::Streaming(PutPayloadBody {
+ payload: value,
+ stream: None,
+ bytes_read: 0,
+ finished: false,
+ })),
+ }
}
}
-#[derive(Debug, Clone)]
+#[derive(Clone)]
enum Inner {
Bytes(Bytes),
PutPayload(usize, PutPayload),
+ Streaming(PutPayloadBody),
+}
+
+struct PutPayloadBody {
+ payload: PutPayload,
+ stream: Option<BoxStream<'static, Result<Bytes, HttpError>>>,
+ bytes_read: usize,
+ finished: bool,
+}
+
+impl Clone for PutPayloadBody {
+ fn clone(&self) -> Self {
+ Self {
+ payload: self.payload.clone(),
+ stream: None,
Review Comment:
This would likely be rather limiting in practice as it would break retries
in client implementations
--
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]