[ 
https://issues.apache.org/jira/browse/BEAM-13015?focusedWorklogId=697537&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-697537
 ]

ASF GitHub Bot logged work on BEAM-13015:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Dec/21 22:04
            Start Date: 16/Dec/21 22:04
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #16252:
URL: https://github.com/apache/beam/pull/16252#discussion_r770951807



##########
File path: 
sdks/java/harness/src/test/java/org/apache/beam/fn/harness/CachesTest.java
##########
@@ -109,15 +121,27 @@ public void testNestedSubCaches() {
     childOfChild.remove("keyB");
     assertEquals("childB", child.peek("keyB"));
     assertNull(childOfChild.peek("keyB"));
+  }
+
+  @Test
+  public void testClearableCache() {
+    ClearableCache<String, String> cache = new 
ClearableCache<>(Caches.eternal());
+    testCache(cache);
+  }
 
-    // Test that clearing the middle cache impacts children but not parent
-    parent.put("keyA", "parentA");
-    parent.put("keyB", "parentB");
-    child.clear();
-    assertThat(child.keys(), is(emptyIterable()));
-    assertThat(childOfChild.keys(), is(emptyIterable()));
-    assertEquals("parentA", parent.peek("keyA"));
-    assertEquals("parentB", parent.peek("keyB"));

Review comment:
       The existing implementation to scan all the keys was too slow so I 
didn't want people to rely on it. This way the have to be cognizant about 
having a cache where they take the memory overhead of tracking the keys 
explicitly,
   
   




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 697537)
    Time Spent: 26h 20m  (was: 26h 10m)

> Optimize Java SDK harness
> -------------------------
>
>                 Key: BEAM-13015
>                 URL: https://issues.apache.org/jira/browse/BEAM-13015
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-harness
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: P2
>          Time Spent: 26h 20m
>  Remaining Estimate: 0h
>
> Use profiling tools to remove bundle processing overhead in the SDK harness.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to