-
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-19242. Aliyun oss add a redirection switch #6967
base: trunk
Are you sure you want to change the base?
Conversation
🎊 +1 overall
This message was automatically generated. |
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.
Thanks for the PR.
PTAL my comments.
@steveloughran Kindly ping. Could you also help to take a look ? Thanks.
} | ||
} | ||
|
||
private void constructOssClient(Configuration conf) throws IOException { |
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.
Could we avoid repeating these codes?
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.
such as is done in AliyunOSSTestUtils
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.
OK,I will simplify the code.
@@ -147,6 +147,13 @@ public void initialize(URI uri, Configuration conf, String user, | |||
throw new IllegalArgumentException(msg); | |||
} | |||
|
|||
boolean redirectEnable = conf.getBoolean(REDIRECT_ENABLE_KEY, | |||
REDIRECT_ENABLE_DEFAULT); | |||
if (!redirectEnable) { |
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.
Could we just use clientConf.setRedirectEnable(redirectEnable);
?
Current implementation always assumes true
is default for clientConf, right ?
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.
1 I will simplify the code to clientConf.setRedirectEnable(redirectEnable)
2 yes,the OSS SDK defaults the redirect setting to true
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.
I think we need to review how other Ailyun integration tests are binding...they should all have the prefix ITest to make clear they are integration tests to only run in a mvn verify
target
REDIRECT_ENABLE_DEFAULT); | ||
if (!redirectEnable) { | ||
clientConf.setRedirectEnable(false); | ||
LOG.info("oss redirectEnable closed"); |
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.
log at debug?
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.
I will change the log level to debug in the next commit
@@ -211,4 +211,8 @@ private Constants() { | |||
public static final String LIST_VERSION = "fs.oss.list.version"; | |||
|
|||
public static final int DEFAULT_LIST_VERSION = 2; | |||
|
|||
// oss redirect | |||
public static final String REDIRECT_ENABLE_KEY = "fs.oss.redirect.enable"; |
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.
add javadocs with {@value}
to show the value...really helps in IDE use
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.
add javadocs with
{@value}
to show the value...really helps in IDE use
OK。I will add javadocs in the next commit。
|
||
package org.apache.hadoop.fs.aliyun.oss; | ||
|
||
import org.apache.commons.lang3.StringUtils; |
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.
nit: import ordering, especially keeping apache stuff on their own
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.
nit: import ordering, especially keeping apache stuff on their own
OK. I will optimize the import ordering
} | ||
} | ||
|
||
private void constructOssClient(Configuration conf) throws IOException { |
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.
such as is done in AliyunOSSTestUtils
* Tests basic functionality for AliyunOSSInputStream, including seeking and | ||
* reading files. | ||
*/ | ||
public class TestAliyunOSSRedirect { |
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.
Is this really trying to talk to the store?
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.
Is this really trying to talk to the store?
This case will access the OSS storage layer for real(This test checks the redirection behavior of Aliyun OSS. When the redirection feature is available, it will access the redirected target file.). but, it does not call seeking. The comment is inaccurate; I will rephrase it.
Currently, none of the OSS test cases have the ITest prefix. I'm not sure about the historical reasons, and I may need to discuss this with other colleagues on the Aliyun OSS team. Can this PR be considered separately from the changes to add the ITest prefix? |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@steveloughran @masteryhx @zeekling hi,I have made the suggested changes to the code. Please take a look again. Thanks. |
Description of PR
How was this patch tested?
New unit tests; cloud store tests
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?