-
Notifications
You must be signed in to change notification settings - Fork 800
SOLR-17161 Create the solrj-jetty module #4038
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?
Conversation
Fix test deps between solrj and solrj-jetty
|
This is the And this is after |
| * @param respBody the body of the response, subclasses must not close this stream. | ||
| */ | ||
| public void onSuccess(Response resp, InputStream respBody) { | ||
| public void onSuccess(Object responseMetadata, InputStream respBody) { |
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.
I dont like Object as type, can we imagine a more specific type that is generic enough for the purpose?
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.
@dsmiley Object is simple, I guess a modern alternative is to use generics:
public class ConcurrentUpdateJettySolrClient extends ConcurrentUpdateBaseSolrClient<org.eclipse.jetty.client.Response> and
public interface StreamingResponse<R>Touches all the same 5 files and all signatures, avoids Object but the API perhaps gets more complicated to understand..
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.
Pull request overview
This PR introduces a new solrj-jetty module to separate Jetty-specific HTTP client code from the core solrj module. This allows users to opt out of Jetty dependencies if they choose to use alternative HTTP client implementations.
Key Changes
- Created new
StreamingResponseabstraction interface to decoupleConcurrentUpdateBaseSolrClientfrom Jetty-specific types - Moved Jetty-dependent classes from
solrjto newsolrj-jettymodule - Updated
ConcurrentUpdateBaseSolrClient.onSuccess()signature to accept genericObjectinstead of JettyResponse
Reviewed changes
Copilot reviewed 34 out of 49 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| solr/solrj/src/java/org/apache/solr/client/solrj/impl/StreamingResponse.java | New abstraction interface for HTTP streaming responses |
| solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateBaseSolrClient.java | Refactored to use StreamingResponse abstraction |
| solr/solrj/build.gradle | Removed Jetty dependencies, added test artifact configuration |
| solr/solrj-jetty/build.gradle | New module build configuration with Jetty dependencies |
| solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/* | Jetty-specific client implementations moved from solrj |
| solr/test-framework/build.gradle | Added dependency on solrj-jetty module |
| settings.gradle | Added solrj-jetty module to project |
| changelog/unreleased/SOLR-17161-separate-jetty-solrj.yml | Changelog entry for the change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dsmiley
left a comment
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.
Thanks for getting this across the line! If I had known 10.0 RC would be in 2026, I'd have done it.
Just some minor feedback. The use of "Object" where you commented is fine.
...solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/ConcurrentUpdateJettySolrClient.java
Outdated
Show resolved
Hide resolved
solr/solrj/src/java/org/apache/solr/client/solrj/impl/StreamingResponse.java
Outdated
Show resolved
Hide resolved
| }) | ||
|
|
||
| // Permit unused test dependencies (transitive dependencies) | ||
| permitTestUnusedDeclared libs.commonsio.commonsio |
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.
Did you actually have to add all of these to make the build happy?
Use of them is each a work-around to a deficiency in the cutterslade plugin . Sometimes I wonder if we'd be better off without that thing. Maybe sharing this pittiful situation here with that project may motivate a proper fix there.
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.
Yea, without these, we get:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':solr:solrj-jetty:analyzeTestClassesDependencies'.
> Dependency analysis found issues.
unusedDeclaredArtifacts
- commons-io:commons-io:2.20.0@jar
- org.apache.httpcomponents:httpclient:4.5.14@jar
- org.apache.httpcomponents:httpcore:4.4.16@jar
- org.apache.lucene:lucene-core:10.3.2@jar
- org.apache.zookeeper:zookeeper-jute:3.9.4@jar
- org.eclipse.jetty.ee10:jetty-ee10-webapp:12.0.27@jar
- org.eclipse.jetty:jetty-server:12.0.27@jar
- org.eclipse.jetty:jetty-session:12.0.27@jar
- org.mockito:mockito-core:5.19.0@jar
Not sure if there is a better solution? @malliaridis ?
solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java
Outdated
Show resolved
Hide resolved
Move private class lower
Separates out new
solr-solrjmodule and moves the jetty specific classes from solrj.Needed to generalize
ConcurrentUpdateBaseSolrClient, and Claude Code chose to do that by abstracting out a newStreamingResponseclass.I did NOT implement a
ConcurrentUpdateJdkSolrClientin this PR, although it should be possible based on the new generic base class...https://issues.apache.org/jira/browse/SOLR-17161