fredia commented on code in PR #26071: URL: https://github.com/apache/flink/pull/26071#discussion_r1928241237
########## flink-runtime/src/main/java/org/apache/flink/streaming/api/operators/sorted/state/BatchExecutionInternalTimeServiceManager.java: ########## @@ -102,14 +113,25 @@ public static <K> InternalTimeServiceManager<K> create( ProcessingTimeService processingTimeService, Iterable<KeyGroupStatePartitionStreamProvider> rawKeyedStates, StreamTaskCancellationContext cancellationContext) { - checkState( - factory instanceof BatchExecutionKeyedStateBackend, - "Batch execution specific time service can work only with BatchExecutionKeyedStateBackend"); + BatchExecutionKeyedStateBackend<K> theFactory; + boolean asyncStateProcessingMode; + if (factory instanceof BatchExecutionKeyedStateBackend) { + theFactory = (BatchExecutionKeyedStateBackend<K>) factory; + asyncStateProcessingMode = false; + } else if (factory instanceof AsyncKeyedStateBackendAdaptor) { + theFactory = + (BatchExecutionKeyedStateBackend<K>) + ((AsyncKeyedStateBackendAdaptor<K>) factory).getKeyedStateBackend(); Review Comment: Check `((AsyncKeyedStateBackendAdaptor<K>) factory).getKeyedStateBackend()` is `BatchExecutionKeyedStateBackend` here? And update the description of `IllegalStateException` below. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org