muralibasani commented on code in PR #23738:
URL: https://github.com/apache/kafka/pull/23738#discussion_r4234255672


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/HeadersStoreUpgradeIntegrationTest.java:
##########
@@ -906,238 +825,151 @@ private void 
processWindowedKeyValueWithHeadersAndVerify(final String key,
         verifyWindowValue(key, value, timestamp, expectedTimestamp, 
expectedHeaders);
     }
 
-    /**
-     * Processor for plain WindowStore (without timestamps or headers).
-     */
-    private static class PlainWindowedProcessor implements Processor<String, 
String, Void, Void> {
-        private WindowStore<String, String> store;
-
-        @Override
-        public void init(final ProcessorContext<Void, Void> context) {
-            store = context.getStateStore(WINDOW_STORE_NAME);
-        }
-
-        @Override
-        public void process(final Record<String, String> record) {
-            final long windowStart = record.timestamp() - (record.timestamp() 
% WINDOW_SIZE_MS);
-            store.put(record.key(), record.value(), windowStart);
-        }
-    }
-
-    /**
-     * Processor for TimestampedWindowStore (without headers).
-     */
-    private static class TimestampedWindowedProcessor implements 
Processor<String, String, Void, Void> {
-        private TimestampedWindowStore<String, String> store;
-
-        @Override
-        public void init(final ProcessorContext<Void, Void> context) {
-            store = context.getStateStore(WINDOW_STORE_NAME);
-        }
-
-        @Override
-        public void process(final Record<String, String> record) {
-            final long windowStart = record.timestamp() - (record.timestamp() 
% WINDOW_SIZE_MS);
-            store.put(record.key(), ValueAndTimestamp.make(record.value(), 
record.timestamp()), windowStart);
-        }
-    }
-
-    /**
-     * Processor for TimestampedWindowStoreWithHeaders (with headers).
-     */
-    private static class TimestampedWindowedWithHeadersProcessor implements 
Processor<String, String, Void, Void> {
-        private TimestampedWindowStoreWithHeaders<String, String> store;
-
-        @Override
-        public void init(final ProcessorContext<Void, Void> context) {
-            store = context.getStateStore(WINDOW_STORE_NAME);
-        }
-
-        @Override
-        public void process(final Record<String, String> record) {
-            final long windowStart = record.timestamp() - (record.timestamp() 
% WINDOW_SIZE_MS);
-            store.put(record.key(),
-                ValueTimestampHeaders.make(record.value(), record.timestamp(), 
record.headers()),
-                windowStart);
-        }
-    }
+    // ==================== Downgrade Tests ====================
 
     @Test
     public void 
shouldFailDowngradeFromTimestampedKeyValueStoreWithHeadersToPlainKeyValueStore()
 throws Exception {
-        final Properties props = props();
-        setupAndPopulateKeyValueStoreWithHeaders(props);
-        kafkaStreams = null;
+        setupAndPopulateKeyValueStoreWithHeaders();
 
         assertDowngradeThrowsProcessorStateException(
             "to plain key-value store",
             Stores.keyValueStoreBuilder(
                 Stores.persistentKeyValueStore(STORE_NAME),
                 Serdes.String(),
                 Serdes.String()),
-            KeyValueProcessor::new, STORE_NAME, props);
+            KEY_VALUE_PROCESSOR, STORE_NAME,
+            "headers-aware", "Downgrade");

Review Comment:
   Good catch, thanks. Plain cases now also require "to regular store" and 
timestamped cases "to timestamped store". Same is applied on RocksDBStore 
branches too.



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