fredia commented on code in PR #25901:
URL: https://github.com/apache/flink/pull/25901#discussion_r1903831266


##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/functions/DeclaringKeyedProcessFunction.java:
##########
@@ -38,17 +37,29 @@
  * and register further timers.
  *
  * <p><b>NOTE:</b> Access to keyed state and timers (which are also scoped to 
a key) is only
- * available if the {@code AsyncKeyedProcessFunction} is applied on a {@code 
KeyedStream}.
+ * available if the {@code DeclaringKeyedProcessFunction} is applied on a 
{@code KeyedStream}.
  *
  * @param <K> Type of the key.
  * @param <I> Type of the input elements.
  * @param <O> Type of the output elements.
  */
 @Internal
-public abstract class AsyncKeyedProcessFunction<K, I, O> extends 
AbstractAsyncStatefulRichFunction {
+public abstract class DeclaringKeyedProcessFunction<K, I, O> extends 
KeyedProcessFunction<K, I, O> {
 
     private static final long serialVersionUID = 1L;
 
+    /** Override and finalize this method. Please use {@link #declareProcess} 
instead. */
+    @Override
+    public final void processElement(I value, Context ctx, Collector<O> out) 
throws Exception {}
+
+    /** Override and finalize this method. Please use {@link #declareOnTimer} 
instead. */
+    @Override
+    public final void onTimer(long timestamp, OnTimerContext ctx, Collector<O> 
out)
+            throws Exception {}
+
+    /** Declaring variables before all processing. */
+    public void declareVariables(DeclarationContext context) {}

Review Comment:
   Is `declareVariables` used for inheritance?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/functions/DeclaringKeyedProcessFunction.java:
##########
@@ -38,17 +37,29 @@
  * and register further timers.
  *
  * <p><b>NOTE:</b> Access to keyed state and timers (which are also scoped to 
a key) is only
- * available if the {@code AsyncKeyedProcessFunction} is applied on a {@code 
KeyedStream}.
+ * available if the {@code DeclaringKeyedProcessFunction} is applied on a 
{@code KeyedStream}.
  *
  * @param <K> Type of the key.
  * @param <I> Type of the input elements.
  * @param <O> Type of the output elements.
  */
 @Internal
-public abstract class AsyncKeyedProcessFunction<K, I, O> extends 
AbstractAsyncStatefulRichFunction {
+public abstract class DeclaringKeyedProcessFunction<K, I, O> extends 
KeyedProcessFunction<K, I, O> {
 
     private static final long serialVersionUID = 1L;
 
+    /** Override and finalize this method. Please use {@link #declareProcess} 
instead. */
+    @Override
+    public final void processElement(I value, Context ctx, Collector<O> out) 
throws Exception {}

Review Comment:
   How about throwing IllegalAccessException here?



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