Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16959: Make CoresLocator class configurable #1891

Merged
merged 9 commits into from
Sep 27, 2023

Conversation

pvcnt
Copy link
Contributor

@pvcnt pvcnt commented Sep 4, 2023

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

Description

I would like to be able to hook into the process of discovering and persisting core descriptors. This allows to work with core descriptors not stored locally, or replicated elsewhere.

Solution

For this purpose, I propose to make the CoresLocator instance configurable, pretty much like other services (e.g., ConfigSetService, some handlers) are already configurable. Attached PR creates a new "coresLocator" parameter in solr.xml in order to achieve this. Because it is created outside of the CoreContainer (it is needed to load a CoreContainer), constructor of a custom CoresLocator receives a NodeConfig object (and not a CoreContainer) that it can use to lookup other parameters, if required.

Tests

I added new unit tests to validate the correct instantiation of a CoresLocator.

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)
  • 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

@pvcnt pvcnt force-pushed the cores-locator-class branch from 2d32cd4 to fe87566 Compare September 4, 2023 13:29
Copy link
Member

@murblanc murblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this Vincent. Looks good to me.

Full disclaimer: I work with Vincent in the same company and that change, in addition to aligning CoresLocator with configuration flexibility available for other classes will also eventually simplify the integration of new types of cores that have no local presence (index Blob/S3 storage Salesforce plans to eventually contribute, see email).

@dsmiley dsmiley changed the title SOLR-16959: Make CoresContainer class configurable SOLR-16959: Make CoresLocator class configurable Sep 5, 2023
@pvcnt pvcnt force-pushed the cores-locator-class branch from 63c6625 to 83455b4 Compare September 6, 2023 13:45
@dsmiley
Copy link
Contributor

dsmiley commented Sep 19, 2023

Can you please add a CHANGES.txt note in the 9.4 section, probably in the "Improvements" section? A brief sentence would do like "Make the internal CoresLocator implementation configurable in solr.xml"

@pvcnt
Copy link
Contributor Author

pvcnt commented Sep 19, 2023

@dsmiley That's done.

# Conflicts:
#	solr/CHANGES.txt
@dsmiley dsmiley merged commit 708ab9b into apache:main Sep 27, 2023
1 of 2 checks passed
dsmiley pushed a commit that referenced this pull request Sep 27, 2023
Co-authored-by: Vincent Primault <[email protected]>
(cherry picked from commit 708ab9b)
@pvcnt pvcnt deleted the cores-locator-class branch January 18, 2024 21:23
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.

3 participants