SOLR-16458: Node system info V2 api jersey resource #4078
+1,101
−591
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-16458
Jira Ticket
The Excel spreadsheet links to SOLR-16458 for the V1 /solr/admin/info/system and V2 /api/node/system, although the ticket does not mention those URLs.
From the checklist below : "I have created a Jira issue and added the issue ID to my pull request title." - m'well, no. But keeping track of these V2 tickets is probably difficult enough without adding one more.
Sorry about the mix-up in the commit messages. I originally landed on the wrong ticket.
Description
Implementation of a Jersey resource to support getting the system info. This new resource should replace the home-brew "Endpoint" V2 resource.
DRAFT:
-- This PR wrap the system info in "nodeInfo":
<response><lst name="responseHeader"><!-- ... --></lst><lst name="nodeInfo"><str name="node">localhost:8983_solr</str><!-- ... --></lst></response>-- Ideally, IMHO, the "node" field should be named "name" (i.e.: the node name), and then the wrapper "nodeInfo" could be just "node"
-- AdminHandlersProxy wraps all proxied responses into a NamedList where the name is the node name (host:port_solr). This creates a structure with unpredictable (or not easily predictable) keys. If we do adopt a response with the "nodeInfo" wrapper, then, the proxied responses could be added to the list of "nodeInfo"... In a specific implementation of AdminHandlersProxy (ref.SOLR-16738: Refactor special-casing out of AdminHandlersProxy #3991). This is all a lot of changes, breaking changes for whoever is parsing the response already. Opinions?
Solution
Add NodeSystemInfoApi (in solr-api), implemented in GetNodeSystemInfo.
Class NodeSystemInfoProvider contains code to provide the system info, copied from SystemInfoHandler.
Clean-up SystemInfoHandler to use GetNodeSystemInfo.
Tests
Add unit tests for NodeSystemInfoProvider (note that the test class for SystemInfoHandler was actually only testing a method now found in NodeSystemInfoProvider).
Add unit tests for GetNodeSystemInfo.
Functional tests on a local instance (dev-slim, started with the "cloud" example)
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.