Skip to content
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

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

zhouaoe
Copy link

@zhouaoe zhouaoe commented Jul 31, 2024

Description of PR

How was this patch tested?

New unit tests; cloud store tests

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 11m 47s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 45m 5s trunk passed
+1 💚 compile 0m 28s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 0m 27s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 0m 27s trunk passed
+1 💚 mvnsite 0m 32s trunk passed
+1 💚 javadoc 0m 33s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 30s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 48s trunk passed
+1 💚 shadedclient 33m 44s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 20s the patch passed
+1 💚 compile 0m 19s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 0m 19s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 0m 17s the patch passed
+1 💚 blanks 0m 1s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 15s /results-checkstyle-hadoop-tools_hadoop-aliyun.txt hadoop-tools/hadoop-aliyun: The patch generated 15 new + 0 unchanged - 0 fixed = 15 total (was 0)
+1 💚 mvnsite 0m 21s the patch passed
+1 💚 javadoc 0m 21s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 18s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 45s the patch passed
+1 💚 shadedclient 33m 34s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 23s hadoop-aliyun in the patch passed.
+1 💚 asflicense 0m 38s The patch does not generate ASF License warnings.
133m 53s
Subsystem Report/Notes
Docker ClientAPI=1.46 ServerAPI=1.46 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/1/artifact/out/Dockerfile
GITHUB PR #6967
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux f740b5f6e52a 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b672ebc
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/1/testReport/
Max. process+thread count 704 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-aliyun U: hadoop-tools/hadoop-aliyun
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Copy link

@masteryhx masteryhx left a 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 {

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?

Copy link
Contributor

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

Copy link
Author

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) {

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 ?

Copy link
Author

@zhouaoe zhouaoe Sep 2, 2024

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

Copy link
Contributor

@steveloughran steveloughran left a 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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log at debug?

Copy link
Author

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";
Copy link
Contributor

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

Copy link
Author

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;
Copy link
Contributor

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

Copy link
Author

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Author

@zhouaoe zhouaoe Sep 2, 2024

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.

@zhouaoe
Copy link
Author

zhouaoe commented Sep 2, 2024

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

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?

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 9m 16s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 45m 41s trunk passed
+1 💚 compile 0m 25s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 0m 24s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 0m 25s trunk passed
+1 💚 mvnsite 0m 29s trunk passed
+1 💚 javadoc 0m 31s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 27s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 45s trunk passed
+1 💚 shadedclient 34m 21s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 19s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 0m 19s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 0m 17s the patch passed
-1 ❌ blanks 0m 0s /blanks-eol.txt The patch has 4 line(s) that end in blanks. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
-0 ⚠️ checkstyle 0m 14s /results-checkstyle-hadoop-tools_hadoop-aliyun.txt hadoop-tools/hadoop-aliyun: The patch generated 5 new + 0 unchanged - 0 fixed = 5 total (was 0)
+1 💚 mvnsite 0m 20s the patch passed
+1 💚 javadoc 0m 19s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 18s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 46s the patch passed
+1 💚 shadedclient 34m 18s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 21s hadoop-aliyun in the patch passed.
+1 💚 asflicense 0m 36s The patch does not generate ASF License warnings.
132m 59s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/3/artifact/out/Dockerfile
GITHUB PR #6967
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux d2ec15b338c8 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / c195866
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/3/testReport/
Max. process+thread count 645 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-aliyun U: hadoop-tools/hadoop-aliyun
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 12m 15s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 46m 29s trunk passed
+1 💚 compile 0m 27s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 0m 26s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 0m 26s trunk passed
+1 💚 mvnsite 0m 29s trunk passed
+1 💚 javadoc 0m 31s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 27s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 44s trunk passed
+1 💚 shadedclient 34m 23s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 19s the patch passed
+1 💚 compile 0m 20s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 0m 20s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 0m 18s the patch passed
-1 ❌ blanks 0m 0s /blanks-eol.txt The patch has 4 line(s) that end in blanks. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
-0 ⚠️ checkstyle 0m 14s /results-checkstyle-hadoop-tools_hadoop-aliyun.txt hadoop-tools/hadoop-aliyun: The patch generated 5 new + 0 unchanged - 0 fixed = 5 total (was 0)
+1 💚 mvnsite 0m 20s the patch passed
+1 💚 javadoc 0m 19s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 19s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 47s the patch passed
+1 💚 shadedclient 34m 0s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 21s hadoop-aliyun in the patch passed.
+1 💚 asflicense 0m 35s The patch does not generate ASF License warnings.
136m 33s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/2/artifact/out/Dockerfile
GITHUB PR #6967
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux c099904aa814 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / c195866
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/2/testReport/
Max. process+thread count 627 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-aliyun U: hadoop-tools/hadoop-aliyun
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 44m 39s trunk passed
+1 💚 compile 0m 29s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 compile 0m 28s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 checkstyle 0m 28s trunk passed
+1 💚 mvnsite 0m 32s trunk passed
+1 💚 javadoc 0m 33s trunk passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 30s trunk passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 47s trunk passed
+1 💚 shadedclient 33m 25s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 20s the patch passed
+1 💚 compile 0m 19s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javac 0m 19s the patch passed
+1 💚 compile 0m 17s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 javac 0m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 16s /results-checkstyle-hadoop-tools_hadoop-aliyun.txt hadoop-tools/hadoop-aliyun: The patch generated 5 new + 0 unchanged - 0 fixed = 5 total (was 0)
+1 💚 mvnsite 0m 21s the patch passed
+1 💚 javadoc 0m 20s the patch passed with JDK Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04
+1 💚 javadoc 0m 19s the patch passed with JDK Private Build-1.8.0_422-8u422-b05-1~20.04-b05
+1 💚 spotbugs 0m 46s the patch passed
+1 💚 shadedclient 33m 46s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 22s hadoop-aliyun in the patch passed.
+1 💚 asflicense 0m 38s The patch does not generate ASF License warnings.
122m 10s
Subsystem Report/Notes
Docker ClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/4/artifact/out/Dockerfile
GITHUB PR #6967
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux e6c6e86593a3 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4c1cb97
Default Java Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.24+8-post-Ubuntu-1ubuntu320.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_422-8u422-b05-1~20.04-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/4/testReport/
Max. process+thread count 552 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-aliyun U: hadoop-tools/hadoop-aliyun
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6967/4/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@zhouaoe
Copy link
Author

zhouaoe commented Sep 4, 2024

@steveloughran @masteryhx @zeekling hi,I have made the suggested changes to the code. Please take a look again. Thanks.
The main changes include simplifying the code mentioned in the comments, updating some comments, and adding Javadoc for the flag.
Additionally, I consulted with other colleagues from the Aliyun OSS team. Since the original code did not include the ITest prefix for OSS integration tests, and the case names have not been changed since then, I do not plan to modify the case names in this PR. I propose creating a separate PR to update the integration test names later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants