Skip to content

[Improvement][server] Refactor code for getTaskLogPath to reduce NPE log during UT#3629

Merged
qiaozhanwei merged 9 commits intoapache:devfrom
hsupu:dev-cl0
Sep 7, 2020
Merged

[Improvement][server] Refactor code for getTaskLogPath to reduce NPE log during UT#3629
qiaozhanwei merged 9 commits intoapache:devfrom
hsupu:dev-cl0

Conversation

@hsupu
Copy link
Copy Markdown
Contributor

@hsupu hsupu commented Aug 31, 2020

What is the purpose of the pull request

  • Refactor code for getTaskLogPath to reduce NPE log during UT

Brief change log

  • Add org.apache.dolphinscheduler.server.utils.LogUtils
  • Remove MasterBaseTaskExecThread.getTaskLogPath
  • Remove org.apache.dolphinscheduler.server.worker.processor.TaskExecuteProcessor.getTaskLogPath

Verify this pull request

This change added tests and can be verified as follows:

  • Added org.apache.dolphinscheduler.server.utils.LogUtilsTest.
  • Tested locally.

@hsupu hsupu changed the title [Improvement][server] Update MasterBaseTaskExecThread.getTaskLogPath to reduce exception log during testing [Improvement][server] Refactor code for getTaskLogPath to reduce NPE log during UT Sep 1, 2020
@CalvinKirs
Copy link
Copy Markdown
Member

There is a code smell, can you try to solve it?

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #3629 into dev will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #3629      +/-   ##
============================================
- Coverage     39.25%   39.22%   -0.04%     
  Complexity     2835     2835              
============================================
  Files           456      457       +1     
  Lines         21608    21612       +4     
  Branches       2623     2621       -2     
============================================
- Hits           8483     8477       -6     
- Misses        12336    12350      +14     
+ Partials        789      785       -4     
Impacted Files Coverage Δ Complexity Δ
...server/master/runner/ConditionsTaskExecThread.java 87.30% <100.00%> (ø) 11.00 <1.00> (ø)
.../server/master/runner/DependentTaskExecThread.java 53.26% <100.00%> (ø) 10.00 <1.00> (ø)
...server/master/runner/MasterBaseTaskExecThread.java 37.50% <100.00%> (-0.31%) 6.00 <0.00> (-1.00)
...apache/dolphinscheduler/server/utils/LogUtils.java 100.00% <100.00%> (ø) 7.00 <7.00> (?)
.../server/worker/processor/TaskExecuteProcessor.java 61.53% <100.00%> (+10.25%) 5.00 <0.00> (-1.00) ⬆️
...he/dolphinscheduler/common/enums/SqoopJobType.java 0.00% <0.00%> (-88.89%) 0.00% <0.00%> (-3.00%)
...dolphinscheduler/common/utils/EncryptionUtils.java 33.33% <0.00%> (-16.67%) 2.00% <0.00%> (ø%)
...lphinscheduler/common/utils/SensitiveLogUtils.java 60.00% <0.00%> (-15.00%) 2.00% <0.00%> (ø%)
...e/dolphinscheduler/common/utils/Preconditions.java 54.54% <0.00%> (-12.13%) 4.00% <0.00%> (ø%)
...he/dolphinscheduler/common/thread/ThreadUtils.java 66.15% <0.00%> (-9.24%) 13.00% <0.00%> (-1.00%)
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc766aa...e99c621. Read the comment docs.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Sep 4, 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 0 Code Smells

89.5% 89.5% Coverage
0.0% 0.0% Duplication

Copy link
Copy Markdown
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

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.

5 participants