hive icon indicating copy to clipboard operation
hive copied to clipboard

HIVE-28557: Eliminate a lot of metrics null check from LlapTaskSchedulerService

Open abstractdog opened this issue 1 year ago • 2 comments

What changes were proposed in this pull request?

  1. Introduce a DummyLlapTaskSchedulerMetrics to eliminate 29 null checks.
  2. 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.

abstractdog avatar Oct 04 '24 09:10 abstractdog

test failures are related, need a bit of rework before the next patch

abstractdog avatar Oct 07 '24 09:10 abstractdog

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.

github-actions[bot] avatar Dec 09 '24 00:12 github-actions[bot]