scwhittle commented on a change in pull request #16495:
URL: https://github.com/apache/beam/pull/16495#discussion_r785784865



##########
File path: 
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/Caches.java
##########
@@ -166,6 +165,10 @@ public int weigh(Object key, WeightedValue<Object> value) {
                             return (int) size;
                           }
                         })
+                    // The maximum size of an entry in the cache is maxWeight 
/ concurrencyLevel
+                    // which is why we set the concurrency level to 1. See
+                    // https://github.com/google/guava/issues/3462 for further 
details.
+                    .concurrencyLevel(1)

Review comment:
       Would be good to verify this setting doesn't add additional contention 
and add that justification to the comment.
   
   If it is worse (are worker threads modifying this directly?) then perhaps it 
would be better to keep the concurrency level and just update option comment 
about maximum element size or log what the maximum size for element can be.




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


Reply via email to