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

[Feature] [Task Plugin] Support emr serverless spark #16126

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

EricGao888
Copy link
Member

@EricGao888 EricGao888 commented Jun 7, 2024

Purpose of the pull request

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@EricGao888 EricGao888 self-assigned this Jun 7, 2024
@github-actions github-actions bot added UI ui and front end related backend document labels Jun 7, 2024
@EricGao888 EricGao888 changed the title [Feature] [Task Plugin] Support emr serverless spark community [Feature] [Task Plugin] Support emr serverless spark Jun 7, 2024
@SbloodyS SbloodyS added the 3.3.0 label Jun 7, 2024
@SbloodyS SbloodyS added this to the 3.3.0 milestone Jun 7, 2024
aliyunServerlessSparkClient = new Client(config);
}

public boolean checkConnect(String accessKeyId, String accessKeySecret, String regionId) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'accessKeyId' is never used.
Copy link
Member Author

Choose a reason for hiding this comment

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

Currently Aliyun EMR Serverless Spark service does not have a specific API to test connection.

aliyunServerlessSparkClient = new Client(config);
}

public boolean checkConnect(String accessKeyId, String accessKeySecret, String regionId) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'accessKeySecret' is never used.
Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above.

aliyunServerlessSparkClient = new Client(config);
}

public boolean checkConnect(String accessKeyId, String accessKeySecret, String regionId) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'regionId' is never used.
Copy link
Member Author

Choose a reason for hiding this comment

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

Same as above.

@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 63.42593% with 79 lines in your changes missing coverage. Please review.

Project coverage is 40.81%. Comparing base (834c320) to head (ee8d664).

Current head ee8d664 differs from pull request most recent head 0552a93

Please upload reports for the commit 0552a93 to get more accurate results.

Files Patch % Lines
...iyunserverlessspark/AliyunServerlessSparkTask.java 74.75% 21 Missing and 5 partials ⚠️
...aram/AliyunServerlessSparkDataSourceProcessor.java 75.51% 10 Missing and 2 partials ⚠️
...yunserverlessspark/AliyunServerlessSparkUtils.java 0.00% 8 Missing ⚠️
...rlessspark/AliyunServerlessSparkTaskException.java 0.00% 6 Missing ⚠️
...verlessspark/AliyunServerlessSparkTaskChannel.java 0.00% 5 Missing ⚠️
...spark/AliyunServerlessSparkTaskChannelFactory.java 0.00% 4 Missing ⚠️
...rlessspark/AliyunServerlessSparkClientWrapper.java 80.00% 3 Missing ⚠️
...sspark/AliyunServerlessSparkDataSourceChannel.java 0.00% 3 Missing ⚠️
...AliyunServerlessSparkDataSourceChannelFactory.java 0.00% 3 Missing ⚠️
...rverlessspark/AliyunServerlessSparkParameters.java 40.00% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##                dev   #16126      +/-   ##
============================================
+ Coverage     40.71%   40.81%   +0.10%     
- Complexity     5246     5273      +27     
============================================
  Files          1385     1397      +12     
  Lines         46109    46324     +215     
  Branches       4923     4931       +8     
============================================
+ Hits          18771    18908     +137     
- Misses        25412    25482      +70     
- Partials       1926     1934       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EricGao888 EricGao888 force-pushed the support-emr-serverless-spark-community branch from 33cc954 to c107f11 Compare June 11, 2024 03:32
@EricGao888 EricGao888 marked this pull request as ready for review June 11, 2024 06:25
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

Gernerally LGTM. Just some questions.

Comment on lines +52 to +53
} catch (Exception e) {
log.info("spark client failed to connect to the server");
Copy link
Member

Choose a reason for hiding this comment

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

Is it better to print stack trace to the logs for better debug?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I missed this one, will fix it.


protected Client buildAliyunServerlessSparkClient(String accessKeyId, String accessKeySecret,
String regionId) throws Exception {
String endpoint = String.format("emr-serverless-spark.%s.aliyuncs.com", regionId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I have seen this string in some other places, maybe a constant is more suitable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, will fix it.

throws Exception {

checkNotNull(accessKeyId, accessKeySecret, regionId);
String endpoint = String.format("emr-serverless-spark.%s.aliyuncs.com", regionId);
Copy link
Contributor

@rickchengx rickchengx Jun 12, 2024

Choose a reason for hiding this comment

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

Overall LGTM, maybe we should make endpoint as a config since users may use endpoint in other formats (etc., in VPC).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Will make it configurable.

Copy link

sonarcloud bot commented Jun 14, 2024

Please retry analysis of this Pull-Request directly on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.3.0 backend document UI ui and front end related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants