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

[Improvement][server] server model ProcessUtils.java code cleaning. #3382

Merged
merged 6 commits into from Aug 25, 2020

Conversation

zhuangchong
Copy link
Contributor

@zhuangchong zhuangchong commented Aug 2, 2020

What is the purpose of the pull request

server model ProccessUtils.java code cleaning.

Brief change log

1.Remove unreferenced variables

2.Remove unnecessary throws exception type.

Verify this pull request

This pull request is code cleanup without any test coverage.

*/
public static void cancelApplication(List<String> appIds, Logger logger, String tenantCode,String executePath)
throws IOException {
public static void cancelApplication(List<String> appIds, Logger logger, String tenantCode,String executePath) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public static void cancelApplication(List<String> appIds, Logger logger, String tenantCode,String executePath) {
public static void cancelApplication(List<String> appIds, Logger logger, String tenantCode, String executePath) {

Hi,
Please configure the checkstyle.xml and codestyle plugin to your ide. It will help to format the code.
[1] https://github.com/apache/incubator-dolphinscheduler/blob/dev/style/checkstyle.xml
[2] https://github.com/apache/incubator-dolphinscheduler/blob/dev/style/intellij-java-code-style.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK,I'll do it. I'll re submit the code

@@ -318,7 +308,7 @@ public static void cancelApplication(List<String> appIds, Logger logger, String

Runtime.getRuntime().exec(runCmd);
} catch (Exception e) {
logger.error("kill application error", e);
logger.error("kill application error : {}",e.getMessage(),e);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no necessary to change this.
If we use

logger.error("kill application error", e);

actually, it is the function of [1], and it will show enough info of this error.
If we use

logger.error("kill application error : {}",e.getMessage(),e);

it will be the function[2]. So we do not need to change this.
[1] image
[2] image

*
* @param processId process id
* @return pids
* @throws Exception exception
*/
public static String getPidsStr(int processId)throws Exception{
public static String getPidsStr(int processId)throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public static String getPidsStr(int processId)throws Exception {
public static String getPidsStr(int processId) throws Exception {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK,I'll change it. At present, ckckstyle has not been detected. I hope it can be added.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK,I'll change it. At present, ckckstyle has not been detected. I hope it can be added.

Ok, Thx for your reminding~

@yangyichao-mango
Copy link
Contributor

Hi~, you can check this ut error[2] through [1]
[1] image
[2] image

@sonarcloud
Copy link

sonarcloud bot commented Aug 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

50.0% 50.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@yangyichao-mango yangyichao-mango left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@qiaozhanwei qiaozhanwei left a comment

Choose a reason for hiding this comment

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

+1

@qiaozhanwei qiaozhanwei merged commit efee53b into apache:dev Aug 25, 2020
@zhuangchong zhuangchong deleted the dev-imp-server-ProcessUtils branch April 22, 2022 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants