Skip to content

refactor: reduce CollectionService internal method visibility - #103

Open
adityamparikh wants to merge 1 commit into
apache:mainfrom
adityamparikh:refactor/collection-service-visibility
Open

refactor: reduce CollectionService internal method visibility#103
adityamparikh wants to merge 1 commit into
apache:mainfrom
adityamparikh:refactor/collection-service-visibility

Conversation

@adityamparikh

Copy link
Copy Markdown
Contributor

Summary

  • Change buildIndexStats(), buildQueryStats(), getCacheMetrics(), getHandlerMetrics() from public to package-private
  • These are internal implementation details that should not be part of the public API surface

Test plan

  • ./gradlew build passes
  • ./gradlew nativeTest -Pnative passes (119/119 tests)
  • No regressions — all existing tests remain in the same package and continue to pass

🤖 Generated with Claude Code

@adityamparikh
adityamparikh force-pushed the refactor/collection-service-visibility branch from fa55fbb to 29ab01a Compare May 2, 2026 17:04
@adityamparikh
adityamparikh force-pushed the refactor/collection-service-visibility branch from 29ab01a to dacb439 Compare June 14, 2026 03:36
…lity

Change buildIndexStats(), buildQueryStats(), getCacheMetrics(), and
getHandlerMetrics() from public to package-private. These are internal
implementation details not called outside the collection package.

Closes #17

Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: adityamparikh <aditya.m.parikh@gmail.com>
@adityamparikh
adityamparikh force-pushed the refactor/collection-service-visibility branch from dacb439 to cd3afee Compare August 19, 2026 11:58
@adityamparikh

Copy link
Copy Markdown
Contributor Author

Rebased onto main (a84033b).

Conflict resolution: main had since marked getCacheMetrics/getHandlerMetrics as public @Nullable (they return null when the metrics endpoint is unavailable, e.g. Solr 10). I kept the @Nullable and applied only the visibility reduction, so both are now package-private and still annotated.

I also re-checked that the narrowing is actually safe: every caller of all four methods — buildIndexStats, buildQueryStats, getCacheMetrics, getHandlerMetrics — lives in org.apache.solr.mcp.server.collection, production and test alike (CollectionServiceTest, CollectionServiceIntegrationTest). Nothing outside the package refers to them, so package-private costs no test access.

Verified: ./gradlew build green on JDK 25.

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.

1 participant