Jess668 commented on code in PR #22666:
URL: https://github.com/apache/kafka/pull/22666#discussion_r3476397552


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/MeteredTimestampedKeyValueStoreWithHeadersTest.java:
##########
@@ -143,6 +151,61 @@ private void init() {
         metered.init(context, metered);
     }
 
+    // --- skipCache propagation: the metered handlers must forward 
isSkipCache() onto the raw
+    //     KeyQuery they build, otherwise the caching layer never sees it (it 
was a no-op before). ---
+
+    @Test
+    public void shouldPropagateSkipCacheForKeyQuery() {
+        setUp();
+        init();
+        
assertTrue(forwardedRawKeyQuery(KeyQuery.withKey(KEY).skipCache()).isSkipCache());
+    }
+
+    @Test
+    public void shouldNotSkipCacheForKeyQueryByDefault() {
+        setUp();
+        init();
+        assertFalse(forwardedRawKeyQuery(KeyQuery.withKey(KEY)).isSkipCache());
+    }
+
+    @Test
+    public void shouldPropagateSkipCacheForTimestampedKeyQuery() {
+        setUp();
+        init();
+        
assertTrue(forwardedRawKeyQuery(TimestampedKeyQuery.withKey(KEY).skipCache()).isSkipCache());
+    }
+
+    @Test
+    public void shouldNotSkipCacheForTimestampedKeyQueryByDefault() {
+        setUp();
+        init();
+        
assertFalse(forwardedRawKeyQuery(TimestampedKeyQuery.withKey(KEY)).isSkipCache());
+    }
+
+    @Test
+    public void shouldPropagateSkipCacheForTimestampedKeyWithHeadersQuery() {
+        setUp();
+        init();
+        
assertTrue(forwardedRawKeyQuery(TimestampedKeyWithHeadersQuery.withKey(KEY).skipCache()).isSkipCache());
+    }
+
+    @Test
+    public void shouldNotSkipCacheForTimestampedKeyWithHeadersQueryByDefault() 
{
+        setUp();
+        init();
+        
assertFalse(forwardedRawKeyQuery(TimestampedKeyWithHeadersQuery.withKey(KEY)).isSkipCache());
+    }
+
+    @SuppressWarnings({"unchecked", "rawtypes"})

Review Comment:
   Came from the same cross-cutting `skipCache` change. Scoping it to the new 
query handler removed the other two copies, so `forwardedRawKeyQuery(...)` is 
now only here. I'll add the shared test util (with the production helper) in 
the follow-up PR that fixes `KeyQuery`/`TimestampedKeyQuery` `skipCache` across 
the metered stores.



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