Au-Miner commented on code in PR #25777: URL: https://github.com/apache/flink/pull/25777#discussion_r1886422285
########## flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/temporal/asyncprocessing/BaseTwoInputAsyncStateStreamOperatorWithStateRetention.java: ########## @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.runtime.operators.join.temporal.asyncprocessing; + +import org.apache.flink.annotation.Internal; +import org.apache.flink.api.common.state.v2.StateFuture; +import org.apache.flink.api.common.state.v2.ValueState; +import org.apache.flink.api.common.typeinfo.Types; +import org.apache.flink.core.state.StateFutureUtils; +import org.apache.flink.runtime.asyncprocessing.operators.AbstractAsyncStateStreamOperator; +import org.apache.flink.runtime.state.VoidNamespace; +import org.apache.flink.runtime.state.VoidNamespaceSerializer; +import org.apache.flink.runtime.state.v2.ValueStateDescriptor; +import org.apache.flink.streaming.api.SimpleTimerService; +import org.apache.flink.streaming.api.operators.InternalTimer; +import org.apache.flink.streaming.api.operators.InternalTimerService; +import org.apache.flink.streaming.api.operators.Triggerable; +import org.apache.flink.streaming.api.operators.TwoInputStreamOperator; +import org.apache.flink.table.data.RowData; + +import java.io.IOException; +import java.util.Optional; + +/** + * An abstract {@link TwoInputStreamOperator} that allows its subclasses to clean up their state in + * async state based on a TTL. This TTL should be specified in the provided {@code minRetentionTime} + * and {@code maxRetentionTime}. + * + * <p>For each known key, this operator registers a timer (in processing time) to fire after the TTL + * expires. When the timer fires, the subclass can decide which state to cleanup and what further + * action to take. + * + * <p>This class takes care of maintaining at most one timer per key. + * + * <p><b>IMPORTANT NOTE TO USERS:</b> When extending this class, do not use processing time timers + * in your business logic. The reason is that: + * + * <p>1) if your timers collide with clean up timers and you delete them, then state clean-up will + * not be performed, and + * + * <p>2) (this one is the reason why this class does not allow to override the onProcessingTime()) Review Comment: 1) The sentences in and 2) are continuous, meaning that the content on line 58 should be immediately followed by 'and', so I think there is no need to add it -- 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]
