dsmiley commented on code in PR #3834:
URL: https://github.com/apache/solr/pull/3834#discussion_r2505074928
##########
solr/core/src/java/org/apache/solr/schema/ManagedIndexSchema.java:
##########
@@ -327,8 +327,8 @@ private static List<Replica> getActiveReplicas(
ClusterState clusterState = zkStateReader.getClusterState();
Set<String> liveNodes = clusterState.getLiveNodes();
final DocCollection docCollection =
clusterState.getCollectionOrNull(collection);
- if (docCollection != null && docCollection.getActiveSlicesArr().length >
0) {
- final Slice[] activeSlices = docCollection.getActiveSlicesArr();
+ if (docCollection != null && !docCollection.getActiveSlices().isEmpty()) {
+ final Collection<Slice> activeSlices = docCollection.getActiveSlices();
for (Slice next : activeSlices) {
Review Comment:
oh, I'm somewhat mistaken... need the docCollection null check. But don't
need the isEmpty check.
This line:
` final Collection<Slice> activeSlices =
docCollection.getActiveSlices();`
Can go away by inlining the reference into the next line (the for loop).
--
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]