Skip to content

Conversation

@gerlowskija
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-16738

Description

AdminHandlersProxy, in its current form, is a bit unwieldy to extend to cover our v2 API: it relies on GenericSolrRequest to send requests, assumes a NamedList in several method signatures, assumes certain parameter names as triggers for proxying, and even has special cases for certain "wt" values. To truly support v2-proxying, AdminHandlersProxy would need to be more flexible about parameter names and SolrJ return types.

Solution

This PR refactors AdminHandlersProxy to make it more amendable for use with v2 APIs going forward. The refactor makes the following changes:

  1. Rather than a cluster of static methods, AdminHandlersProxy is now an abstract parent class that provides the general structure of request proxying, error-handling, and response-parsing and aggregation.
  2. Specific details that might vary on an API-by-API basis are now isolated in concrete AdminHandlersProxy implementations. These concrete impls act essentially as "strategies" defining nitty-gritty details of how proxying should happen and how responses should be handled. Two implementations are provided in this PR: PrometheusRequestProxy and NormalV1RequestProxy (better name pending - 😬).
    • This doesn't totally cover everything we need for v2 APIs but the division of "abstract-parent" and "concrete-strategy-impl" gives us a much firmer foundation for v2 to build on.
  3. All of the involved classes are moved into a new "core" package: o.a.s.handler.admin.proxy

Tests

Unit tests for AdminHandlersProxy, PrometheusRequestProxy, and NormalV1RequestProxy will be added prior to coming out of "draft" mode.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

@janhoy
Copy link
Contributor

janhoy commented Dec 30, 2025

Nice direction.

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