tolbertam commented on code in PR #3917:
URL: https://github.com/apache/cassandra/pull/3917#discussion_r2040866531
##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -109,15 +116,8 @@ public class QueryProcessor implements QueryHandler
.executor(ImmediateExecutor.INSTANCE)
.maximumWeight(capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMiB()))
.weigher(QueryProcessor::getSizeOfPreparedStatementForCache)
- .removalListener((key, prepared, cause) -> {
- MD5Digest md5Digest = (MD5Digest) key;
- if (cause.wasEvicted())
- {
- metrics.preparedStatementsEvicted.inc();
-
lastMinuteEvictionsCount.incrementAndGet();
-
SystemKeyspace.removePreparedStatement(md5Digest);
- }
- }).build();
+ .removalListener((key, prepared, cause) ->
evictPreparedStatement(key, cause))
Review Comment:
This may look a bit unnecessary, but needed this to instrument byteman to
detect when this happens as `removePreparedStatement` is called in other code
paths. I think the code is marginally more concise/unharmfull in any case.
--
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]