wqshr12345 commented on code in PR #25233: URL: https://github.com/apache/flink/pull/25233#discussion_r1731118174
########## flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/HeapKeyedStateBackend.java: ########## @@ -475,6 +482,32 @@ public LocalRecoveryConfig getLocalRecoveryConfig() { return localRecoveryConfig; } + @Override + public void setup(@Nonnull StateRequestHandler stateRequestHandler) {} + + @Nonnull + @Override + public <N, S extends org.apache.flink.api.common.state.v2.State, SV> S createState( + @Nonnull N defaultNamespace, + @Nonnull TypeSerializer<N> namespaceSerializer, + @Nonnull org.apache.flink.runtime.state.v2.StateDescriptor<SV> stateDesc) + throws Exception { + StateDescriptorTransformer transformer = new StateDescriptorTransformer(); + StateDescriptor stateDescV1 = transformer.getStateDescriptor(stateDesc); + State state = getOrCreateKeyedState(namespaceSerializer, stateDescV1); + if (stateDescV1.getType() == StateDescriptor.Type.VALUE) { + return (S) new ValueStateWrapper((ValueState) state); + } + throw new UnsupportedOperationException( + String.format("Unsupported state type: %s", stateDesc.getType())); + } + + @Nonnull + @Override + public StateExecutor createStateExecutor() { + return null; + } + Review Comment: Good idea, the comment has been addressed. -- 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