Skip to content

StorageManager tech debt 6/6: deprecated SearchCriteria.addAnd - #14564

Open
DaanHoogland wants to merge 1 commit into
ghi12316-storage-trivial-warningsfrom
ghi12316-storage-addand-deprecations
Open

DaanHoogland wants to merge 1 commit into
ghi12316-storage-trivial-warningsfrom
ghi12316-storage-addand-deprecations

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Depends on #14562

Description

Stack for #12316 (StorageManager tech debt), one PR per item of the issue checklist, review only the top commit of each:

  1. StorageManager tech debt 1/6: remove unused methods, fields and return values #13598: unused methods, fields and return values
  2. never-thrown checked exceptions
  3. raw types and unchecked casts
  4. never-used parameters
  5. remaining trivial warnings
  6. deprecated SearchCriteria.addAnd usages

This PR (6/6) replaces the deprecated SearchCriteria.addAnd() calls in StorageManagerImpl (10 warnings → 0) with SearchBuilders declared once in configure(), like the existing LocalStorageSearch:

  • createCapacityEntry: PoolCapacitySearch (hostOrPoolId, dataCenterId, capacityType)
  • getStoragePoolUsedStatsInternal: PoolUsedStatsSearch. Optional zone/pod/cluster/id filters are only set when given; unset conditions are dropped from the WHERE clause, as before. The criteria are now only built in the branch that actually searches: when a single poolId is given, the old code built them and then used findById anyway.
  • getSecondaryStorageUsedStats: removes a SearchCriteria that was built but never used.

After this stack, the only javac warnings left in these files are the 4 Config deprecations, which #14467 handles.

Fixes: #12316

Types of changes

  • Cleanup (Code refactoring and cleanup, that may add test cases)

🤖 Generated with Claude Code

Fixes #12316

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.88%. Comparing base (974b403) to head (3321a06).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           ghi12316-storage-trivial-warnings   #14564   +/-   ##
==================================================================
  Coverage                               3.88%    3.88%           
==================================================================
  Files                                    493      493           
  Lines                                  42571    42571           
  Branches                                8069     8069           
==================================================================
  Hits                                    1653     1653           
  Misses                                 40687    40687           
  Partials                                 231      231           
Flag Coverage Δ
uitests 3.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deal with tech debt in StorageManager(Impl)

1 participant