Skip to content

Conversation

@skysanjay
Copy link
Contributor

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

  • SOLR-17461: (cleanup) Move ClusterState string "Interner" json parser to Utils

Description

ClusterState.setStrInternerParser and its functionality is potentially of general utility and it's also a bit distracting in ClusterState. I also don't like CoreContainer being involved in initializing it (CoreContainer is doing too much!). It's doing it because ClusterState is in SolrJ without Caffeine being on the classpath. Instead, imagine a class in solr-core that implements this Function. Utils could then self-initialize via reflection detecting if that class is available, otherwise gracefully resorting to the non-intern mechanism. No touching CoreContainer which is way too busy doing many things.

Solution

moved the common method to Utils, the WeakStringInterner initialization is based on availability of caffeine classed and it will conditionally change the STR_INTERNER_OBJ_BUILDER of the ClusterState object

Tests

it is not applicable but will try to add junit for same.

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

skysanjay and others added 14 commits November 29, 2025 18:19
# Conflicts:
#	solr/core/src/java/org/apache/solr/response/CborResponseWriter.java
CborResponseWriter should use content-type: application/cbor
CborResponseWriter should use content-type: application/cbor(change log)
…ould-use-content-type-application/cbor

SOLR-17787
(cleanup) Move ClusterState string "Interner" json parser to Utils
…461-Move-ClusterState-string-json-parser-to-Utils
(cleanup) Move ClusterState string "Interner" json parser to Utils
(cleanup) Move ClusterState string "Interner" json parser to Utils
…ing-json-parser-to-Utils

Solr 17461 move cluster state string json parser to utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant