You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/08/02 07:14:47 UTC

[GitHub] [incubator-dolphinscheduler] zhuangchong opened a new pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

zhuangchong opened a new pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382


   ## 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.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r464942211



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -352,13 +342,13 @@ public static void kill(TaskExecutionContext taskExecutionContext) {
   }
 
   /**
-   * get pids str
+   * get pids str.
    *
    * @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 {

Review comment:
       ```suggestion
     public static String getPidsStr(int processId) throws Exception {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] zhuangchong commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r465414774



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -352,13 +342,13 @@ public static void kill(TaskExecutionContext taskExecutionContext) {
   }
 
   /**
-   * get pids str
+   * get pids str.
    *
    * @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 {

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




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] qiaozhanwei merged pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
qiaozhanwei merged pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] zhuangchong commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
zhuangchong commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r464852273



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -283,10 +275,8 @@ private static boolean needsEscaping(int verificationType, String arg) {
    * @param logger      logger
    * @param tenantCode  tenant code
    * @param executePath     execute path
-   * @throws IOException io exception
    */
-  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) {

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




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#issuecomment-668922653


   Hi~, you can check this ut error[2] through [1]
   [1] ![image](https://user-images.githubusercontent.com/29545877/89362124-9f8c5480-d6ff-11ea-9548-528c39828aed.png)
   [2] ![image](https://user-images.githubusercontent.com/29545877/89362091-8d121b00-d6ff-11ea-8fcb-4bbcd4a12f0f.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r464073072



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -283,10 +275,8 @@ private static boolean needsEscaping(int verificationType, String arg) {
    * @param logger      logger
    * @param tenantCode  tenant code
    * @param executePath     execute path
-   * @throws IOException io exception
    */
-  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) {

Review comment:
       ```suggestion
     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




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r464073806



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -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);

Review comment:
       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](https://user-images.githubusercontent.com/29545877/89123415-b7968500-d501-11ea-849e-c58201936ac3.png)
   [2] ![image](https://user-images.githubusercontent.com/29545877/89123428-dd238e80-d501-11ea-88b7-656ba432af42.png)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r465421585



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -352,13 +342,13 @@ public static void kill(TaskExecutionContext taskExecutionContext) {
   }
 
   /**
-   * get pids str
+   * get pids str.
    *
    * @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 {

Review comment:
       > OK,I'll change it. At present, ckckstyle has not been detected. I hope it can be added.
   
   Ok, Thx for your reminding~




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on a change in pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on a change in pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#discussion_r464073806



##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/ProcessUtils.java
##########
@@ -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);

Review comment:
       There is no necessary to change this.
   If we use
   ```
   logger.error("kill application error", e);
   ```
   actually, it is the function of [1].
   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](https://user-images.githubusercontent.com/29545877/89123415-b7968500-d501-11ea-849e-c58201936ac3.png)
   [2] ![image](https://user-images.githubusercontent.com/29545877/89123428-dd238e80-d501-11ea-88b7-656ba432af42.png)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] commented on pull request #3382: [Improvement][server] server model ProcessUtils.java code cleaning.

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #3382:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3382#issuecomment-670408288


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/proje
 ct/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=3382&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/50.png' alt='50.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=3382&metric=new_coverage&view=list) [50.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=3382&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=3382&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=3382&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org