From cd3afee489e28b453c748af76b5cacc6f9520dc0 Mon Sep 17 00:00:00 2001 From: adityamparikh Date: Fri, 24 Apr 2026 14:09:02 -0400 Subject: [PATCH] refactor(collection): reduce CollectionService internal method visibility 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 Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: adityamparikh --- .../solr/mcp/server/collection/CollectionService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java b/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java index 011d278e..b54dedb6 100644 --- a/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java +++ b/src/main/java/org/apache/solr/mcp/server/collection/CollectionService.java @@ -573,7 +573,7 @@ public SolrMetrics getCollectionStats( * @see IndexStats * @see LukeResponse */ - public IndexStats buildIndexStats(LukeResponse lukeResponse) { + IndexStats buildIndexStats(LukeResponse lukeResponse) { NamedList indexInfo = lukeResponse.getIndexInfo(); // Extract index information using helper methods @@ -614,7 +614,7 @@ public IndexStats buildIndexStats(LukeResponse lukeResponse) { * @see QueryStats * @see QueryResponse */ - public QueryStats buildQueryStats(QueryResponse response) { + QueryStats buildQueryStats(QueryResponse response) { return new QueryStats(response.getQTime(), response.getResults().getNumFound(), response.getResults().getStart(), response.getResults().getMaxScore()); @@ -669,7 +669,7 @@ public QueryStats buildQueryStats(QueryResponse response) { * @see #extractCacheStats(NamedList) * @see #isCacheStatsEmpty(CacheStats) */ - public @Nullable CacheStats getCacheMetrics(String collection) throws SolrServerException, IOException { + @Nullable CacheStats getCacheMetrics(String collection) throws SolrServerException, IOException { String actualCollection = extractCollectionName(collection); if (!validateCollectionExists(actualCollection)) { @@ -785,7 +785,7 @@ private CacheStats extractCacheStats(NamedList coreMetrics) { * @see #fetchFlatHandlerInfo(String, String, String) * @see #isHandlerStatsEmpty(HandlerStats) */ - public @Nullable HandlerStats getHandlerMetrics(String collection) throws SolrServerException, IOException { + @Nullable HandlerStats getHandlerMetrics(String collection) throws SolrServerException, IOException { String actualCollection = extractCollectionName(collection); if (!validateCollectionExists(actualCollection)) {