You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/04/26 10:47:15 UTC

[GitHub] [hadoop] steveloughran commented on a change in pull request #774: HADOOP-16256: HTTPFileSystem disallows users from configuring the connectionTimeout and readTimeout of HttpClient

steveloughran commented on a change in pull request #774: HADOOP-16256: HTTPFileSystem disallows users from configuring the connectionTimeout and readTimeout of HttpClient
URL: https://github.com/apache/hadoop/pull/774#discussion_r278898398
 
 

 ##########
 File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/http/AbstractHttpFileSystem.java
 ##########
 @@ -57,7 +64,14 @@ public URI getUri() {
 
   @Override
   public FSDataInputStream open(Path path, int bufferSize) throws IOException {
+    int httpConnectTimeoutInMillis = conf.getInt(CONF_HTTP_CONNECT_TIMEOUT, DEFAULT_HTTP_CONNECT_TIMEOUT_IN_MILLIS);
+    int httpReadTimeoutInMillis = conf.getInt(CONF_HTTP_READ_TIMEOUT, DEFAULT_HTTP_READ_TIMEOUT_IN_MILLIS);
+    Preconditions.checkState(httpConnectTimeoutInMillis > 0, "Http connection timeout has to greater than zero.");
 
 Review comment:
   better:
   ```
   "Invalid value of " + CONF_HTTP_CONNECT_TIMEOUT +": %d ", httpConnectTimeoutInMillis)
   ```
   This lists the property name and the actual value set. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org