You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "roeap (via GitHub)" <gi...@apache.org> on 2023/05/12 00:29:57 UTC

[GitHub] [arrow-rs] roeap opened a new pull request, #4208: feat(object-store): extend client option configuration keys

roeap opened a new pull request, #4208:
URL: https://github.com/apache/arrow-rs/pull/4208

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #4208: feat(object-store): extend Options API for http client

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #4208:
URL: https://github.com/apache/arrow-rs/pull/4208


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] roeap commented on a diff in pull request #4208: feat(object-store): extend client option configuration keys

Posted by "roeap (via GitHub)" <gi...@apache.org>.
roeap commented on code in PR #4208:
URL: https://github.com/apache/arrow-rs/pull/4208#discussion_r1191937269


##########
object_store/Cargo.toml:
##########
@@ -33,6 +33,7 @@ async-trait = "0.1.53"
 bytes = "1.0"
 chrono = { version = "0.4.23", default-features = false, features = ["clock"] }
 futures = "0.3"
+humantime = "2.1"

Review Comment:
   Here we introduce a new dependency, but since humantime itself comes dependency-free i felt we can justify this?
   
   The crate has not seen any updated for quite some time, but is relied upon by some of the msot widely used crates, like cargo, clap, and rustsec.



##########
object_store/src/config.rs:
##########
@@ -79,3 +84,51 @@ impl Parse for bool {
         }
     }
 }
+
+impl Parse for Duration {
+    fn parse(v: &str) -> Result<Self> {
+        parse_duration(v).map_err(|_| Error::Generic {
+            store: "Config",
+            source: format!("failed to parse \"{v}\" as Duration").into(),
+        })
+    }
+}
+
+impl Parse for usize {
+    fn parse(v: &str) -> Result<Self> {
+        Self::from_str(v).map_err(|_| Error::Generic {
+            store: "Config",
+            source: format!("failed to parse \"{v}\" as usize").into(),
+        })
+    }
+}
+
+impl Parse for HeaderValue {
+    fn parse(v: &str) -> Result<Self> {
+        Self::from_str(v).map_err(|_| Error::Generic {
+            store: "Config",
+            source: format!("failed to parse \"{v}\" as HeaderValue").into(),
+        })
+    }
+}
+
+pub(crate) fn fmt_duration(duration: &ConfigValue<Duration>) -> String {

Review Comment:
   `Duration` does not implement `Display`, but we also cannot implement `Display` for `ConfigValue<Duration>`, since the compiler believes this may be implemented one day, at which time it would conflict with the generic implementation. Thus i went for a simple function.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] roeap commented on a diff in pull request #4208: feat(object-store): extend Options API for http client

Posted by "roeap (via GitHub)" <gi...@apache.org>.
roeap commented on code in PR #4208:
URL: https://github.com/apache/arrow-rs/pull/4208#discussion_r1191937269


##########
object_store/Cargo.toml:
##########
@@ -33,6 +33,7 @@ async-trait = "0.1.53"
 bytes = "1.0"
 chrono = { version = "0.4.23", default-features = false, features = ["clock"] }
 futures = "0.3"
+humantime = "2.1"

Review Comment:
   Here we introduce a new dependency, but since humantime itself comes dependency-free i felt we can justify this?
   
   The crate has not seen any updates for quite some time, but is relied upon by some of the msot widely used crates, like cargo, clap, and rustsec.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4208: feat(object-store): extend Options API for http client

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #4208:
URL: https://github.com/apache/arrow-rs/pull/4208#discussion_r1192244173


##########
object_store/src/client/mod.rs:
##########
@@ -115,14 +212,45 @@ impl ClientOptions {
     pub fn get_config_value(&self, key: &ClientConfigKey) -> Option<String> {
         match key {
             ClientConfigKey::AllowHttp => Some(self.allow_http.to_string()),
+            ClientConfigKey::AllowInvalidCertificates => {
+                Some(self.allow_insecure.to_string())
+            }
+            ClientConfigKey::ConnectTimeout => {
+                self.connect_timeout.as_ref().map(fmt_duration)
+            }
+            ClientConfigKey::DefaultContentType => self.default_content_type.clone(),
+            ClientConfigKey::Http1Only => Some(self.http1_only.to_string()),
+            ClientConfigKey::Http2KeepAliveInterval => {
+                self.http2_keep_alive_interval.as_ref().map(fmt_duration)
+            }
+            ClientConfigKey::Http2KeepAliveTimeout => {
+                self.http2_keep_alive_timeout.as_ref().map(fmt_duration)
+            }
+            ClientConfigKey::Http2KeepAliveWhileIdle => {
+                Some(self.http2_keep_alive_while_idle.to_string())
+            }
+            ClientConfigKey::Http2Only => Some(self.http2_only.to_string()),
+            ClientConfigKey::PoolIdleTimeout => {
+                self.pool_idle_timeout.as_ref().map(fmt_duration)
+            }
+            ClientConfigKey::PoolMaxIdlePerHost => {
+                self.pool_max_idle_per_host.as_ref().map(|v| v.to_string())
+            }
+            ClientConfigKey::ProxyUrl => self.proxy_url.clone(),
+            ClientConfigKey::Timeout => self.timeout.as_ref().map(fmt_duration),
+            ClientConfigKey::UserAgent => self

Review Comment:
   You might be able to make this more legible by using `?`



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org