[
https://issues.apache.org/jira/browse/HADOOP-18889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17776498#comment-17776498
]
ASF GitHub Bot commented on HADOOP-18889:
-----------------------------------------
virajjasani commented on code in PR #6180:
URL: https://github.com/apache/hadoop/pull/6180#discussion_r1363235836
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/AWSClientConfig.java:
##########
@@ -378,17 +388,39 @@ private static void initSigner(Configuration conf,
*/
private static void initRequestTimeout(Configuration conf,
ClientOverrideConfiguration.Builder clientConfig) {
- long requestTimeoutMillis = conf.getTimeDuration(REQUEST_TIMEOUT,
- DEFAULT_REQUEST_TIMEOUT, TimeUnit.SECONDS, TimeUnit.MILLISECONDS);
+ final Duration requestTimeoutMillis = getDuration(conf, REQUEST_TIMEOUT,
+ DEFAULT_REQUEST_TIMEOUT, TimeUnit.SECONDS);
- if (requestTimeoutMillis > Integer.MAX_VALUE) {
- LOG.debug("Request timeout is too high({} ms). Setting to {} ms instead",
- requestTimeoutMillis, Integer.MAX_VALUE);
- requestTimeoutMillis = Integer.MAX_VALUE;
+ if (requestTimeoutMillis.toMillis() > 0) {
+ clientConfig.apiCallAttemptTimeout(requestTimeoutMillis);
}
+ }
- if(requestTimeoutMillis > 0) {
-
clientConfig.apiCallAttemptTimeout(Duration.ofMillis(requestTimeoutMillis));
+ /**
+ * Get duration. This may be negative; callers must check.
+ * If the config option is greater than {@code Integer.MAX_VALUE}
milliseconds,
+ * it is set to that max.
+ * Logs the value for diagnostics.
+ * @param conf config
+ * @param name option name
+ * @param defVal default value
+ * @param defaultUnit unit of default value
+ * @return duration. may be negative.
+ */
+ private static Duration getDuration(final Configuration conf,
Review Comment:
nit: `getDurationInMillis` or `getDurationWithMillis` might be better?
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/AWSClientConfig.java:
##########
@@ -378,17 +388,39 @@ private static void initSigner(Configuration conf,
*/
private static void initRequestTimeout(Configuration conf,
ClientOverrideConfiguration.Builder clientConfig) {
- long requestTimeoutMillis = conf.getTimeDuration(REQUEST_TIMEOUT,
- DEFAULT_REQUEST_TIMEOUT, TimeUnit.SECONDS, TimeUnit.MILLISECONDS);
+ final Duration requestTimeoutMillis = getDuration(conf, REQUEST_TIMEOUT,
+ DEFAULT_REQUEST_TIMEOUT, TimeUnit.SECONDS);
- if (requestTimeoutMillis > Integer.MAX_VALUE) {
- LOG.debug("Request timeout is too high({} ms). Setting to {} ms instead",
- requestTimeoutMillis, Integer.MAX_VALUE);
- requestTimeoutMillis = Integer.MAX_VALUE;
+ if (requestTimeoutMillis.toMillis() > 0) {
+ clientConfig.apiCallAttemptTimeout(requestTimeoutMillis);
}
+ }
- if(requestTimeoutMillis > 0) {
-
clientConfig.apiCallAttemptTimeout(Duration.ofMillis(requestTimeoutMillis));
+ /**
+ * Get duration. This may be negative; callers must check.
+ * If the config option is greater than {@code Integer.MAX_VALUE}
milliseconds,
+ * it is set to that max.
+ * Logs the value for diagnostics.
+ * @param conf config
+ * @param name option name
+ * @param defVal default value
+ * @param defaultUnit unit of default value
+ * @return duration. may be negative.
Review Comment:
nit: `Get duration` -> `Get duration object representing value in
milliseconds`?
> S3A: V2 SDK client does not work with third-party store
> -------------------------------------------------------
>
> Key: HADOOP-18889
> URL: https://issues.apache.org/jira/browse/HADOOP-18889
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 3.4.0
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Critical
> Labels: pull-request-available
> Fix For: 3.4.0
>
>
> testing against an external store without specifying region now blows up
> because the region is queried off eu-west-1.
> What are we do to here? require the region setting *which wasn't needed
> before? what even region do we provide for third party stores?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]