Skip to content

Fix load Sonar warnings#17882

Open
Caideyipi wants to merge 1 commit into
masterfrom
fix-load-sonar-comments
Open

Fix load Sonar warnings#17882
Caideyipi wants to merge 1 commit into
masterfrom
fix-load-sonar-comments

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

This PR fixes Sonar warnings in load-related code by:

  • replacing a Map get/null/put pattern with computeIfAbsent in load routing.
  • checking Optional presence before accessing TsFileResource start/end times.
  • reusing a guarded ActiveLoadEntry value instead of repeated Optional.get() calls.

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the why and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR
  • LoadSingleTsFileNode
  • LoadTsFileScheduler
  • ActiveLoadTsFileLoader
Tests
  • mvn '-Ddevelocity.off=true' spotless:check -pl iotdb-core/datanode
  • git diff --check

@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.66%. Comparing base (a437cd4) to head (c96ee4d).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...n/planner/plan/node/load/LoadSingleTsFileNode.java 0.00% 8 Missing ⚠️
...rageengine/load/active/ActiveLoadTsFileLoader.java 0.00% 8 Missing ⚠️
...ngine/plan/scheduler/load/LoadTsFileScheduler.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17882      +/-   ##
============================================
- Coverage     40.67%   40.66%   -0.02%     
- Complexity     2620     2621       +1     
============================================
  Files          5244     5244              
  Lines        362349   362353       +4     
  Branches      46650    46651       +1     
============================================
- Hits         147385   147347      -38     
- Misses       214964   215006      +42     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants