bereng commented on a change in pull request #1398:
URL: https://github.com/apache/cassandra/pull/1398#discussion_r783642456
##########
File path: src/java/org/apache/cassandra/cql3/QueryEvents.java
##########
@@ -250,10 +242,19 @@ public void notifyPrepareFailure(@Nullable CQLStatement
statement, String query,
}
}
- private String possiblyObfuscateQuery(CQLStatement statement, String query)
+ private String maybeObfuscatePassword(CQLStatement statement, String query)
{
// Statement might be null as side-effect of failed parsing,
originates from QueryMessage#execute
- return null == statement || statement instanceof
AuthenticationStatement ? passwordObfuscator.obfuscate(query) : query;
+ String res;
+
+ if (statement == null)
+ res = PasswordObfuscator.obfuscate(query);
+ else if (statement instanceof AuthenticationStatement)
+ res = ((AuthenticationStatement)
statement).obfuscatePassword(query);
+ else
+ res = query;
+
+ return res;
Review comment:
Funny. I'd swore I replied already to this in the 4.0 PR but I can't
find my answer anywhere now.
This is intentional for performance. On branching you want to avoid
returning results as this breaks CPU branching optimizations/prediction. You
want the construct I used (as per the perf training we did).
Also on a personal note, I don't find it any harder to read than the
alternative :shrug:
--
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]