You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/03/10 23:14:20 UTC

[GitHub] [kafka] mjsax commented on a change in pull request #10293: [KAFKA-12449] Remove deprecated WindowStore#put

mjsax commented on a change in pull request #10293:
URL: https://github.com/apache/kafka/pull/10293#discussion_r591938958



##########
File path: streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractWindowBytesStoreTest.java
##########
@@ -710,73 +710,9 @@ public void testPutAndFetchAfter() {
         assertNull(entriesByKey.get(6));
     }
 
-    @Test
-    @SuppressWarnings("deprecation")
-    public void testPutSameKeyTimestamp() {

Review comment:
       Why removing the whole test?

##########
File path: streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractWindowBytesStoreTest.java
##########
@@ -710,73 +710,9 @@ public void testPutAndFetchAfter() {
         assertNull(entriesByKey.get(6));
     }
 
-    @Test
-    @SuppressWarnings("deprecation")
-    public void testPutSameKeyTimestamp() {
-        windowStore = buildWindowStore(RETENTION_PERIOD, WINDOW_SIZE, true, Serdes.Integer(), Serdes.String());
-        windowStore.init((StateStoreContext) context, windowStore);
-
-        final long startTime = SEGMENT_INTERVAL - 4L;
-
-        setCurrentTime(startTime);
-        windowStore.put(0, "zero");
-
-        assertEquals(
-            new HashSet<>(Collections.singletonList("zero")),
-            valuesToSet(windowStore.fetch(0, ofEpochMilli(startTime - WINDOW_SIZE),
-                ofEpochMilli(startTime + WINDOW_SIZE))));
-
-        windowStore.put(0, "zero");
-        windowStore.put(0, "zero+");
-        windowStore.put(0, "zero++");
-
-        assertEquals(
-            new HashSet<>(asList("zero", "zero", "zero+", "zero++")),
-            valuesToSet(windowStore.fetch(
-                0,
-                ofEpochMilli(startTime - WINDOW_SIZE),
-                ofEpochMilli(startTime + WINDOW_SIZE))));
-        assertEquals(
-            new HashSet<>(asList("zero", "zero", "zero+", "zero++")),
-            valuesToSet(windowStore.fetch(
-                0,
-                ofEpochMilli(startTime + 1L - WINDOW_SIZE),
-                ofEpochMilli(startTime + 1L + WINDOW_SIZE))));
-        assertEquals(
-            new HashSet<>(asList("zero", "zero", "zero+", "zero++")),
-            valuesToSet(windowStore.fetch(
-                0,
-                ofEpochMilli(startTime + 2L - WINDOW_SIZE),
-                ofEpochMilli(startTime + 2L + WINDOW_SIZE))));
-        assertEquals(
-            new HashSet<>(asList("zero", "zero", "zero+", "zero++")),
-            valuesToSet(windowStore.fetch(
-                0,
-                ofEpochMilli(startTime + 3L - WINDOW_SIZE),
-                ofEpochMilli(startTime + 3L + WINDOW_SIZE))));
-        assertEquals(
-            new HashSet<>(Collections.emptyList()),
-            valuesToSet(windowStore.fetch(
-                0,
-                ofEpochMilli(startTime + 4L - WINDOW_SIZE),
-                ofEpochMilli(startTime + 4L + WINDOW_SIZE))));
-
-        // Flush the store and verify all current entries were properly flushed ...
-        windowStore.flush();
-
-        final List<KeyValue<byte[], byte[]>> changeLog = new ArrayList<>();
-        for (final ProducerRecord<Object, Object> record : recordCollector.collected()) {
-            changeLog.add(new KeyValue<>(((Bytes) record.key()).get(), (byte[]) record.value()));
-        }
-
-        final Map<Integer, Set<String>> entriesByKey = entriesByKey(changeLog, startTime);
-
-        assertEquals(Utils.mkSet("zero@0", "zero@0", "zero+@0", "zero++@0"), entriesByKey.get(0));
-    }
-
     @Test
     public void shouldCloseOpenIteratorsWhenStoreIsClosedAndNotThrowInvalidStateStoreExceptionOnHasNext() {
-        setCurrentTime(0);
+        context.setRecordContext(createRecordContext(0));

Review comment:
       Do we need to set the record context?




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