Skip to content

Conversation

@psalagnac
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-17931

Refactored collection creation command so it does not use internals of ShardRequestTracker, but uses it to submit requests with public methods.

Refactored collection creation command so it does not use internals of ShardRequestTracker.
Comment on lines -366 to -372
ShardRequest sreq = new ShardRequest();
sreq.nodeName = nodeName;
params.set("qt", ccc.getAdminPath());
sreq.purpose = ShardRequest.PURPOSE_PRIVATE;
sreq.shards = new String[] {baseUrl};
sreq.actualShards = sreq.shards;
sreq.params = params;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what became of this?

Copy link
Contributor Author

@psalagnac psalagnac Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have commented in the PR. This is all done by calling shardRequestTracker.sendShardRequest() that then calls ShardHandler. To me, this is all internal to shard handler, there was no good reasons to duplicate this in the command.

}

/** Internal structure to track cores to create with the collection. */
private record CoreToCreate(String nodeName, ModifiableSolrParams params) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing that this named structure adds any clarity, honestly. But if you think so then ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this may be too verbose. I removed it and used a simple map instead.

@psalagnac psalagnac merged commit bb4682d into apache:main Oct 20, 2025
3 of 4 checks passed
@psalagnac psalagnac deleted the deprecated-track branch October 20, 2025 19:10
psalagnac added a commit that referenced this pull request Oct 20, 2025
Refactored collection creation command so it does not use internals of ShardRequestTracker, but uses it to submit requests with public methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants