tzulitai commented on a change in pull request #8618:  
[FLINK-12732][state-processor-api] Add savepoint reader for consuming 
partitioned operator state
URL: https://github.com/apache/flink/pull/8618#discussion_r296548329
 
 

 ##########
 File path: 
flink-libraries/flink-state-processing-api/src/main/java/org/apache/flink/state/api/functions/KeyedStateReaderFunction.java
 ##########
 @@ -0,0 +1,82 @@
+/*
+ * 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.state.api.functions;
+
+import org.apache.flink.annotation.PublicEvolving;
+import org.apache.flink.api.common.functions.AbstractRichFunction;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.util.Collector;
+
+/**
+ * A function that processes keys from a restored operator
+ *
+ * <p>For every key {@link #readKey(Object, Context, Collector)} is invoked. 
This can produce zero or more
+ * elements as output.
+ *
+ * <p><b>NOTE:</b> State descriptors must be eagerly registered in {@code 
open(Configuration)}. Any
+ * attempt to dynamically register states inside of {@code readKey} will 
result in a {@code
+ * RuntimeException}.
+ *
+ * <p><b>NOTE:</b> A {@code KeyedStateReaderFunction} is always a {@link
+ * org.apache.flink.api.common.functions.RichFunction}. Therefore, access to 
the {@link
+ * org.apache.flink.api.common.functions.RuntimeContext} is always available 
and setup and teardown
+ * methods can be implemented. See {@link
+ * org.apache.flink.api.common.functions.RichFunction#open(Configuration)} and 
{@link
+ * org.apache.flink.api.common.functions.RichFunction#close()}.
+ *
+ * @param <K> Type of the keys
+ * @param <OUT> Type of the output elements.
+ */
+@PublicEvolving
+public abstract class KeyedStateReaderFunction<K, OUT> extends 
AbstractRichFunction {
+
+       /**
+        * Initialization method for the function. It is called before {@link 
#readKey(Object,
+        * Context, Collector)} and thus suitable for one time setup work.
+        *
+        * <p>This is the only method that my register state descriptors within 
a {@code
 
 Review comment:
   typo: only method that `may` ...

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to