jaibheem commented on code in PR #3317:
URL: https://github.com/apache/cassandra/pull/3317#discussion_r1609024015
##########
src/java/org/apache/cassandra/dht/RangeStreamer.java:
##########
@@ -317,17 +322,26 @@ public void addRanges(String keyspaceName,
ReplicaCollection<?> replicas)
{
Keyspace keyspace = Keyspace.open(keyspaceName);
AbstractReplicationStrategy strat = keyspace.getReplicationStrategy();
+ ReplicationParams params = keyspace.getMetadata().params.replication;
if(strat instanceof LocalStrategy)
{
logger.info("Not adding ranges for Local Strategy keyspace={}",
keyspaceName);
return;
}
+ if (fetchMapPerReplicationParams.containsKey(params))
+ {
+ if (toFetch.put(keyspaceName,
fetchMapPerReplicationParams.get(params)) != null)
+ throw new IllegalArgumentException("Keyspace is already added
to fetch map");
+ logger.info("Reusing pre-calculated fetch map for keyspace {} with
rf={}", keyspaceName, params);
+ return;
+ }
+
boolean useStrictSource = useStrictSourcesForRanges(strat);
EndpointsByReplica fetchMap =
calculateRangesToFetchWithPreferredEndpoints(replicas, keyspace,
useStrictSource);
for (Map.Entry<Replica, Replica> entry : fetchMap.flattenEntries())
- logger.info("{}: range {} exists on {} for keyspace {}",
description, entry.getKey(), entry.getValue(), keyspaceName);
+ logger.info("{}: range {} exists on {} for rf {}", description,
entry.getKey(), entry.getValue(), params);
Review Comment:
just a suggestion, does this need to be debug while the keyspace is in info
logger? this can generate lot of log lines when the token range is large.
--
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]