SOLR-18126 Benchmark, refactor: MiniClusterState -> SolrBenchState#4196
Open
dsmiley wants to merge 4 commits intoapache:mainfrom
Open
SOLR-18126 Benchmark, refactor: MiniClusterState -> SolrBenchState#4196dsmiley wants to merge 4 commits intoapache:mainfrom
dsmiley wants to merge 4 commits intoapache:mainfrom
Conversation
MiniClusterState is renamed to SolrBenchState to better reflect that this state class will support multiple backend strategies beyond just the mini cluster approach. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pure structural refactor with no functional changes: - Moved @State annotation from inner class to outer class - Removed MiniClusterBenchState inner class declaration - De-indented all inner class content - Updated all benchmarks to use SolrBenchState directly - Renamed parameter from miniClusterState to solrBenchState
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.
This is a preparatory refactoring step on a short journey to solr/benchmark supporting multiple backends (not just MiniSolrCloudCluster). This PR renames
bench/MiniClusterState.javatobench/SolrBenchState.java, and flattens its structure, which had an inner class. Two lifecycle methods containing "miniCluster" in the name were replaced with "solr" to be generic, and I improved javadocs slightly. That's it; I held back on doing anything else; this is just a simple refactoring. Any other code you see is as-is, unchanged. This PR will make a future PR much easier to review from a diff standpoint, and/or it allows more baby-steps.I suppose one might say: why not embrace JMH's class / injection design on this journey, such that MiniClusterState would continue to exist but so would other future ones like a hypothetical RemoteSolrState. Pursuing that would lead to a common base class, holding most of the functionality that's there now (e.g. the index methods). I chose a different path in which a common/universal benchmark state class
SolrBenchStatewill delegate to aSolrBackend. The instantiation/configuration is where the only difference lies. Subclassing could be done to handle that but there's so little to it that I didn't bother. Even if we wind up wanting that approach after all, I still think this PR is helpful to that possible eventuality as well, since we'd still need aSolrBenchStateand containing most of what you see in it.https://issues.apache.org/jira/browse/SOLR-18126