Repository navigation
Conversation
Converts the NamedList instantiations in solrj whose keys provably never repeat: Schema API request bodies (SchemaRequest, except MultiUpdate, which repeats keys on purpose), JsonMapResponseParser's result, the pivot-facet map in QueryResponse, ConcurrentUpdateBaseSolrClient's dummy response and CloudSolrClient's per-route exception list. No declared types or wire formats change. Adds a SimpleOrderedMap(Map) constructor mirroring NamedList's. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XL2ChskWQPpS1niMQgCaQa
It is ambiguous with SimpleOrderedMap(MapWriter) for arguments that implement both, such as SolrInputDocument, so existing callers would stop compiling. SchemaRequest builds its map-fed entries through a private helper instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XL2ChskWQPpS1niMQgCaQa
Asserts that AddFieldType and AddField serialize exactly like the same structure built from plain maps, and that MultiUpdate keeps repeated command keys. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XL2ChskWQPpS1niMQgCaQa
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XL2ChskWQPpS1niMQgCaQa
|
Automated PR triage (LLM-generated; may be wrong). Checked once, when the PR was opened or marked ready; not updated on later pushes. 2 possible mismatch(es) between what this change warrants and what the PR includes.
|
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XL2ChskWQPpS1niMQgCaQa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
First slice of SIP-22 step 5 (SOLR-18612): in
solr/solrj, create aSimpleOrderedMapinstead of aNamedListwherever the keys provably never repeat. Instantiation sites only; no declared types, method signatures or wire formats change.Solution
The solrj main sources have 46
new NamedListsites in 13 files. 27 are converted; 19 stay, each for a stated reason.Converted (27)
SchemaRequest(23 of 24): Schema API request bodies: field-type and analyzer definitions built fromMaps, and the one-key wrappers such as{"add-field": …}.Utils.writeJsonserializesNamedListandSimpleOrderedMapthrough the sameMapWriterpath, so the JSON sent to the server is unchanged.QueryResponse._facetPivot(keyed by pivot spec),JsonMapResponseParser's result (filled from a parsedMap),ConcurrentUpdateBaseSolrClient's dummy response, andCloudSolrClient's per-route exception list: client-side objects with unique keys.Kept as
NamedList(19)JavaBinCodec.readNamedList, and theJavaBinUpdateRequestCodecrequest envelope and its reader (the server's streaming reader only hooks theNAMED_LSTtag; the existing comment onparamsin that file documents the same constraint).SchemaRequest.MultiUpdate(repeats"add-field"etc. in one body), XML<lst>parsing inDOMUtilandConfigNode(SIP step 8), and inCloudSolrClient:shardResponses(the non-routable request reuses a route URL as key), per-id version lists (a batch may contain an id twice), and exception metadata merged from several exceptions.RemoteSolrException's metadata rebuild, where repeats are not provably absent.NamedList.clone()/getImmutableCopy(),ResponseCanonicalizer.SolrResponseBaseand the merged header inCloudSolrClient.condenseResponse.One thing tried and reverted: a
SimpleOrderedMap(Map)constructor mirroringNamedList's. It is ambiguous with the existingSimpleOrderedMap(MapWriter)for arguments implementing both (SolrInputDocument,SimpleOrderedMapitself), so existing callers would stop compiling. The map-fed sites inSchemaRequestgo through a private helper instead.Compatibility of this slice: no JSON-visible and no javabin-visible change. The JSON-visible effects the ticket describes come with the
solr/coreslice, which follows as a separate PR.AI disclosure: the site classification, the edits and this description were drafted with Claude Code and reviewed by me.
Tests
New
SchemaRequestBodyTest(solrj, no server) pins the request bodies: anAddFieldTypewith analyzer and similarity, and anAddField, must serialize byte-for-byte like the same structure built from plainLinkedHashMaps, which is this PR's claim stated as an assertion; and aMultiUpdatemust keep its repeatedadd-fieldkeys, which guards the one site deliberately left asNamedList.Also ran:
./gradlew tidy; the full:solr:solrj:testsuite; the 30solr/coretest classes that useSchemaRequest,JsonMapResponseParseror pivot facets (schema API, bulk schema, managed schema, pivot-facet distributed tests, V2 API integration, ZooKeeper admin handlers); and./gradlew check -x test. All pass. (The Antora ref-guide task is excluded locally because its UI-bundle download can't go through my environment's proxy; no ref-guide content changes here.)Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.