schizophrenicmaniac commented on code in PR #41603:
URL: https://github.com/apache/beam/pull/41603#discussion_r4685190285


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/state/WindmillMultimap.java:
##########
@@ -375,6 +420,7 @@ public Iterable<V> read() {
           it.extendWith(persistedValues);
           keyState.values = it;
           keyState.valuesSize = Iterables.size(persistedValues);
+          keyState.setValuesWeight(((Weighted) persistedValues).getWeight());

Review Comment:
   Good catch. get() now encodes the key before calling 
necessaryKeyEntriesFromStorageFuture (which takes the encoded key now) and 
records its size once the read returns, so the key is counted along with the 
values.



##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/windmill/state/WindmillStateInternalsTest.java:
##########
@@ -3859,6 +3859,76 @@ public void testCachedCombining() throws Exception {
     Mockito.verifyNoMoreInteractions(mockReader);
   }
 
+  @Test
+  public void testCachedMultimap() throws Exception {

Review Comment:
   Added testCachedMultimapReadOnly, which only reads the key and then 
persists, and checks that both the key and the values are in the cache weight.



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