HIVE-28557: Eliminate a lot of metrics null check from LlapTaskSchedulerService
What changes were proposed in this pull request?
- Introduce a DummyLlapTaskSchedulerMetrics to eliminate 29 null checks.
- Moving all metrics system initialization to the LlapTaskSchedulerMetrics class where it belongs.
Why are the changes needed?
Eliminate boilerplate. Repeating null check is a code smell that implies there is no clear contract about whether the field is null. This is now handled by initializing a dummy instance and letting the rest of the code ignore what's going on with metrics actually.
Does this PR introduce any user-facing change?
No.
Is the change a dependency upgrade?
No.
How was this patch tested?
Precommit.
Quality Gate passed
Issues
3 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
test failures are related, need a bit of rework before the next patch
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reach out on the [email protected] list if the patch is in need of reviews.