serhiy-bzhezytskyy opened a new pull request, #4811: URL: https://github.com/apache/solr/pull/4811
Removes `ContentStream` from SolrJ's client write path in favor of `ContentWriter`, per the ticket. This required solving the multipart gap flagged in my earlier comment: `ContentWriter` only supported a single stream, and `ContentStreamUpdateRequest` (Solr Cell/Tika uploads, `bin/solr` configset upload) falls back to the deprecated `getContentStreams()` whenever more than one stream is added. Added `RequestWriter.MultipartContentWriter` -- a marker sub-interface of `ContentWriter` exposing `List<NamedPart>` (name + a per-part `ContentWriter`). `HttpJettySolrClient` builds a real `multipart/form-data` body from it (verified end-to-end with a new test against a real Jetty server: `HttpJettySolrClientTest#testMultipartUpload`). `HttpJdkSolrClient` keeps 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 by `getContentWriter()`), and the cross-dc module's `MirroredConfigSetRequest` (migrated to the new API; kept a `getRawContentStreams()` accessor for the Kafka serializer, which needs the raw per-stream bytes/metadata directly). **Scope note, not fully covered by the ticket title**: `ContentStream` itself cannot be removed -- it's also the server-*read*-side contract (`SolrQueryRequest#getContentStreams()`, ~50 files in `solr/core`), which `ContentWriter` has 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 the `RequestWriter` dispatch) 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`/`forbiddenApis` clean. New end-to-end multipart test passes; ran the affected suites (`HttpJettySolrClientTest`, `HttpJdkSolrClientTest`, `TestConfigSetsAPI`, `MirroringConfigSetsHandlerTest`, `EmbeddedSolrNoSerializeTest`, `WrappedSolrRequestTest`) -- all green. AI-assisted (Claude Sonnet 5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
