maedhroz commented on code in PR #3350:
URL: https://github.com/apache/cassandra/pull/3350#discussion_r1629961763
##########
src/java/org/apache/cassandra/index/IndexStatusManager.java:
##########
@@ -84,26 +85,39 @@ private IndexStatusManager()
*/
public <E extends Endpoints<E>> E filterForQuery(E liveEndpoints, Keyspace
keyspace, Index.QueryPlan indexQueryPlan, ConsistencyLevel level)
{
+ int required = level.blockFor(keyspace.getReplicationStrategy());
+ ReplicaCollection.Builder<E> buildSucceededEndpoints =
liveEndpoints.newBuilder(0);
Review Comment:
```suggestion
ReplicaCollection.Builder<E> buildSucceededEndpoints =
liveEndpoints.newBuilder(liveEndpoints.size());
```
The only other option would be to use `required` as an initial size, but I
think we'll expect most nodes to be in the `BUILD_SUCCEEDED` state most of the
time, so that would force more array creations. For instance, if we have an RF
= 3, and CL = QUORUM, we probably want to use `liveEndpoints.size()` which
would be 3, instead of using 2 and having to do an extra array copy if all
three replicas are `BUILD_SUCCEEDED`.
WDYT?
--
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]