-
Notifications
You must be signed in to change notification settings - Fork 857
SOLR-18378: remove CoreContainer.getCores() and SolrCores.getCores(), 26 sites #4764
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
base: main
Are you sure you want to change the base?
Changes from all commits
f419f8f
7b012ef
b0f6cd7
e08ef92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc | ||
| title: Remove the deprecated CoreContainer.getCores() and SolrCores.getCores() methods, which handed out cores without reserving them. Use getLoadedCoreNames() with getCore(String) and close each core, or getLoadedCoreNames().size() when only a count is needed. | ||
| type: removed | ||
| authors: | ||
| - name: Serhiy Bzhezytskyy | ||
| links: | ||
| - name: SOLR-18378 | ||
| url: https://issues.apache.org/jira/browse/SOLR-18378 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,20 +142,6 @@ public SolrCore putCore(CoreDescriptor cd, SolrCore core) { | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * @return A list of "permanent" cores, i.e. cores that may not be swapped out and are currently | ||
| * loaded. | ||
| * <p>A core may be non-transient but still lazily loaded. If it is "permanent" and lazy-load | ||
| * _and_ not yet loaded it will _not_ be returned by this call. | ||
| * <p>This list is a new copy, it can be modified by the caller (e.g. it can be sorted). | ||
| */ | ||
| @Deprecated | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe shouldn't be deprecated after all (as I say above
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the AI-assisted (Claude Sonnet 5)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think either we bring this back, or we add the method I suggested to CoreContainer
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
| public List<SolrCore> getCores() { | ||
| synchronized (modifyLock) { | ||
| return new ArrayList<>(cores.values()); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Gets the cores that are currently loaded, i.e. cores that have 1: loadOnStartup=true and are | ||
| * either not-transient or, if transient, have been loaded and have not been aged out 2: | ||
|
|
@@ -189,7 +175,7 @@ public List<String> getAllCoreNames() { | |
|
|
||
| /** | ||
| * Gets the number of currently loaded permanent (non transient) cores. Faster equivalent for | ||
| * {@link #getCores()}.size(). | ||
| * {@link #getLoadedCoreNames()}.size(). | ||
| */ | ||
| public int getNumLoadedPermanentCores() { | ||
| synchronized (modifyLock) { | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice; this is safer as we avoid race condition on a core closing with inspecting its health |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again; added safety :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably, SolrCores.getCores() shouldn't be deprecated because it's hidden one layer deep on a class only used by CoreContainer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair -- checked, and
SolrCoresis package-private and only ever referenced fromCoreContainer, so the deprecation was arguably unnecessary ceremony from the start. Not making a case for the original deprecation though -- the ticket scope was to remove bothgetCores()methods together, so that's what this PR does.AI-assisted (Claude Sonnet 5)