SOLR-18130: rename parameter "zkHost" to "solrCloud" in "solrj-streaming"#4320
Draft
vyatkinv wants to merge 1 commit intoapache:mainfrom
Draft
SOLR-18130: rename parameter "zkHost" to "solrCloud" in "solrj-streaming"#4320vyatkinv wants to merge 1 commit intoapache:mainfrom
vyatkinv wants to merge 1 commit intoapache:mainfrom
Conversation
27f4ae5 to
c877f2a
Compare
Contributor
|
Shouldn't |
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.
https://issues.apache.org/jira/browse/SOLR-18130
Description
This PR updates the solrj-streaming module by replacing all usages of zkHost with solrCloud to enable support for HTTP-based quorum configurations.
Solution
Parameters, fields and variables in solrj-streaming, named as
zkHostrenamed tosolrCloudFor backward compatibility, specifying zkHost is still supported.
A shared method has been introduced in an abstract class to resolve the effective solrCloud value using a priority-based approach (e.g., explicit parameter → legacy zkHost → default Zookeeper host).
Tests
To Be Done
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.Planned follow-ups:
Open Questions / Discussion Points
I would appreciate feedback on the following topics (also noted as TODOs in the code):
1. Mandatory solrCloud parameter
I made solrCloud required in all stream handlers (an error is thrown if it cannot be resolved from parameters or the default Zookeeper host).
This caused two tests to fail:
StreamExpressionTest#testCloudSolrStreamStreamExpressionTest#testStatsStreamThese tests did not provide any valid host.
I fixed them by adding
.withDefaultZkHost(cluster.getZkServer().getZkAddress())Question:
Is this a test issue or a flaw in the implementation?
Can such a situation occur in real-world usage?
2. toExpression behavior and backward compatibility
Currently, toExpression reconstructs the expression and always includes solrCloud, even if the user originally provided the legacy zkHost parameter.
As a result, a user who runs an expression with zkHost and then calls explain() will see solrCloud in the output.
Question:
3. Potential issue with gather parameter
In:
org/apache/solr/client/solrj/io/graph/GatherNodesStream.java:392there is the following line:
expression.addParameter(new StreamExpressionNamedParameter("gather", solrCloud));Question:
UPDATE: I looked into the context more deeply and yes, it looks like this is a defect that affects explain(). I fixed it as part of my pull request.
4. Inconsistent parameter handling
Some stream handlers use Map<String, String> for parameters, while others use ModifiableSolrParams.
Question:
Would it make sense to standardize on a single approach?
5. ScoreNodesStream limitation
ScoreNodesStreamcan only obtain zkHost / solrCloud via:factory.getDefaultZkHost();Question: