-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HADOOP-16256: HTTPFileSystem disallows users from configuring the connectionTimeout and readTimeout of HttpClient #774
base: trunk
Are you sure you want to change the base?
Conversation
…nectionTimeout and readTimeout of HttpClient.
🎊 +1 overall
This message was automatically generated. |
@@ -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."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better:
"Invalid value of " + CONF_HTTP_CONNECT_TIMEOUT +": %d ", httpConnectTimeoutInMillis)
This lists the property name and the actual value set.
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."); | ||
Preconditions.checkState(httpReadTimeoutInMillis > 0, "Http read timeout has to greater than zero."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+Same here
@@ -39,13 +40,19 @@ | |||
abstract class AbstractHttpFileSystem extends FileSystem { | |||
private static final long DEFAULT_BLOCK_SIZE = 4096; | |||
private static final Path WORKING_DIR = new Path("/"); | |||
private static final String CONF_HTTP_READ_TIMEOUT = "yarn.nodemanager.localizer.http.read.timeout.ms"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- these should be somewhere where they can be referred to in code, such as a new class
HttpFileSystemConstants
- And their name must be that of the filesystem class, not anything related to the RM.
|
||
Configuration conf = new Configuration(false); | ||
conf.set("fs.http.impl", HttpFileSystem.class.getCanonicalName()); | ||
conf.set("yarn.nodemanager.localizer.http.connect.timeout.ms", "-1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the values set in HttpFileSystemConstants
Code looks good, tests look great. Key comments
|
🎊 +1 overall
This message was automatically generated. |
Patch still has outstanding suggestions and checkstyle issues. Other than that I'm happy with it |
…sage __key__ to accept any format Author: Aditya Toomula <atoomula@linkedin.com> Reviewers: Srinivasulu Punuru <spunuru@linkedin.com> Closes apache#774 from atoomula/keyformat
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
No description provided.