SOLR-18351: remove ContentStream from SolrJ's client write path - #4811
Open
serhiy-bzhezytskyy wants to merge 2 commits into
Open
SOLR-18351: remove ContentStream from SolrJ's client write path#4811serhiy-bzhezytskyy wants to merge 2 commits into
serhiy-bzhezytskyy wants to merge 2 commits into
Conversation
Adds MultipartContentWriter/NamedPart to RequestWriter so a request with several named parts can go through getContentWriter() instead of the deprecated getContentStreams() fallback -- HttpJettySolrClient builds a real multipart/form-data body from it (verified end-to-end against a real Jetty server); HttpJdkSolrClient keeps rejecting multipart, as before. ContentStream itself stays: it's still the server-read-side contract (SolrQueryRequest#getContentStreams, ~50 core files), which ContentWriter has no equivalent for.
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.
Removes
ContentStreamfrom SolrJ's client write path in favor ofContentWriter, per the ticket. This required solving the multipart gap flagged in my earlier comment:ContentWriteronly supported a single stream, andContentStreamUpdateRequest(Solr Cell/Tika uploads,bin/solrconfigset upload) falls back to the deprecatedgetContentStreams()whenever more than one stream is added.Added
RequestWriter.MultipartContentWriter-- a marker sub-interface ofContentWriterexposingList<NamedPart>(name + a per-partContentWriter).HttpJettySolrClientbuilds a realmultipart/form-databody from it (verified end-to-end with a new test against a real Jetty server:HttpJettySolrClientTest#testMultipartUpload).HttpJdkSolrClientkeeps its existing behavior of rejecting multipart outright (it never supported it).Removed the now-dead
getContentStreams()overrides across the client write path:SolrRequest,RequestWriter(+ its two implementations),WrappedSolrRequest,ContentStreamUpdateRequest,ConfigSetAdminRequest.Upload(was already fully covered bygetContentWriter()), and the cross-dc module'sMirroredConfigSetRequest(migrated to the new API; kept agetRawContentStreams()accessor for the Kafka serializer, which needs the raw per-stream bytes/metadata directly).Scope note, not fully covered by the ticket title:
ContentStreamitself cannot be removed -- it's also the server-read-side contract (SolrQueryRequest#getContentStreams(), ~50 files insolr/core), whichContentWriterhas no read-side equivalent for. This PR only removes it from the client write path. Flagging explicitly since my first comment on this ticket mentioned this in passing rather than as its own question -- worth confirming this is the intended scope.All 3 places that read a
ContentStreamUpdateRequest's raw streams directly (bypassing theRequestWriterdispatch) were updated to handle both the single- and multi-part case:EmbeddedSolrServer(in-process client), and the cross-dc module's serializer/test.Full repo
compileTestJava/spotlessJavaCheck/ecjLint/forbiddenApisclean. New end-to-end multipart test passes; ran the affected suites (HttpJettySolrClientTest,HttpJdkSolrClientTest,TestConfigSetsAPI,MirroringConfigSetsHandlerTest,EmbeddedSolrNoSerializeTest,WrappedSolrRequestTest) -- all green.AI-assisted (Claude Sonnet 5)