You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/07/14 04:54:31 UTC

[GitHub] [cassandra] maedhroz commented on a change in pull request #582: Add support for lazy NoSpamLogger argument evaluation

maedhroz commented on a change in pull request #582:
URL: https://github.com/apache/cassandra/pull/582#discussion_r454099460



##########
File path: src/java/org/apache/cassandra/utils/memory/BufferPool.java
##########
@@ -232,8 +236,8 @@ private Chunk allocateMoreChunks()
                     if (MEMORY_USAGE_THRESHOLD > 0)
                     {
                         noSpamLogger.info("Maximum memory usage reached ({}), cannot allocate chunk of {}",
-                                          prettyPrintMemory(MEMORY_USAGE_THRESHOLD),
-                                          prettyPrintMemory(MACRO_CHUNK_SIZE));
+                                          () -> params(prettyPrintMemory(MEMORY_USAGE_THRESHOLD),
+                                                       prettyPrintMemory(MACRO_CHUNK_SIZE)));

Review comment:
       @jonmeredith Possibly naive question...why don't we just pre-compute human readable versions of `MEMORY_USAGE_THRESHOLD` and `MACRO_CHUNK_SIZE` (using `prettyPrintMemory()`)? There are some tests that write to `MEMORY_USAGE_THRESHOLD` of course, but we can get a `static` setter in place that updates its "companion" as well.
   
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org