muralibasani commented on code in PR #22901:
URL: https://github.com/apache/kafka/pull/22901#discussion_r3669875780
##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/HeadersStoreUpgradeIntegrationTest.java:
##########
@@ -1295,20 +1157,7 @@ private boolean windowStoreContainsKey(final String key,
final long timestamp) {
final ReadOnlyWindowStore<String, ValueTimestampHeaders<String>>
store =
IntegrationTestUtils.getStore(WINDOW_STORE_NAME, kafkaStreams,
QueryableStoreTypes.timestampedWindowStoreWithHeaders());
- if (store == null) {
- return false;
- }
-
- final long expectedWindowStart = timestamp - (timestamp %
WINDOW_SIZE_MS);
- try (final KeyValueIterator<Windowed<String>,
ValueTimestampHeaders<String>> iterator = store.all()) {
- while (iterator.hasNext()) {
- final KeyValue<Windowed<String>,
ValueTimestampHeaders<String>> kv = iterator.next();
- if (kv.key.key().equals(key) && kv.key.window().start() ==
expectedWindowStart) {
- return true;
- }
- }
- }
- return false;
+ return store != null && findWindowedValue(store, key,
timestamp).isPresent();
Review Comment:
Done, deleted both windowStoreContainsKey and sessionStoreContainsKey and
folded their two call sites into awaitStore.
--
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]