carp84 commented on a change in pull request #13761:
URL: https://github.com/apache/flink/pull/13761#discussion_r511604575



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializer.java
##########
@@ -57,5 +59,42 @@ StreamOperatorStateContext streamOperatorStateContext(
                @Nullable TypeSerializer<?> keySerializer,
                @Nonnull CloseableRegistry streamTaskCloseableRegistry,
                @Nonnull MetricGroup metricGroup,
-               double managedMemoryFraction) throws Exception;
+               double managedMemoryFraction,
+               boolean isUsingCustomRawKeyedState) throws Exception;
+
+       /**
+        * Returns the {@link StreamOperatorStateContext} for an {@link 
AbstractStreamOperator} that runs in the stream
+        * task that owns this manager.
+        *
+        * @param operatorID the id of the operator for which the context is 
created. Cannot be null.
+        * @param operatorClassName the classname of the operator instance for 
which the context is created. Cannot be null.
+        * @param processingTimeService
+        * @param keyContext the key context of the operator instance for which 
the context is created Cannot be null.
+        * @param keySerializer the key-serializer for the operator. Can be 
null.
+        * @param streamTaskCloseableRegistry the closeable registry to which 
created closeable objects will be registered.
+        * @param metricGroup the parent metric group for all statebackend 
metrics
+        * @param managedMemoryFraction the managed memory fraction of the 
operator for state backend
+        * @return a context from which the given operator can initialize 
everything related to state.
+        * @throws Exception when something went wrong while creating the 
context.
+        */
+       default StreamOperatorStateContext streamOperatorStateContext(

Review comment:
       Correct me if I'm wrong, but `StreamTaskStateInitializer` seems to be an 
internal interface rather than user-facing, so I suggest to remove this old 
interface and use the new one only.
   
   There're two callers of this old interface:
   * `KeyedStateInputFormat` clearly doesn't use raw keyed state
   * `AbstractStreamOperatorV2` seems to be special, the javadoc marks it as 
some experimental new base for all stream operators, but there's no production 
code using it yet. I would suggest to also apply the changes to this "new 
base", and suggest we double check with @pnowojski about the plan.




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


Reply via email to