Class BeamStateRequestHandler

  • All Implemented Interfaces:
    org.apache.beam.runners.fnexecution.state.StateRequestHandler

    public class BeamStateRequestHandler
    extends Object
    implements org.apache.beam.runners.fnexecution.state.StateRequestHandler
    The handler for Beam state requests sent from Python side, which does actual operations on Flink state.
    • Method Detail

      • handle

        public CompletionStage<org.apache.beam.model.fnexecution.v1.BeamFnApi.StateResponse.Builder> handle​(org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest request)
                                                                                                     throws Exception
        Specified by:
        handle in interface org.apache.beam.runners.fnexecution.state.StateRequestHandler
        Throws:
        Exception
      • getCacheTokens

        public Iterable<org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleRequest.CacheToken> getCacheTokens()
        Specified by:
        getCacheTokens in interface org.apache.beam.runners.fnexecution.state.StateRequestHandler
      • of

        public static BeamStateRequestHandler of​(@Nullable
                                                 org.apache.flink.runtime.state.KeyedStateBackend<?> keyedStateBackend,
                                                 @Nullable
                                                 org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend,
                                                 @Nullable
                                                 org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer,
                                                 @Nullable
                                                 org.apache.flink.api.common.typeutils.TypeSerializer<?> namespaceSerializer,
                                                 org.apache.flink.configuration.ReadableConfig config)
        Parameters:
        keyedStateBackend - if null, BeamStateRequestHandler would throw an error when receive keyed-state requests.
        operatorStateBackend - if null, BeamStateRequestHandler would throw an error when receive operator-state requests.
        keySerializer - key serializer for KeyedStateBackend, must not be null if keyedStatedBackend is not null.
        namespaceSerializer - namespace serializer for KeyedStateBackend, could be null when there's no window logic involved.
        config - state-related configurations
        Returns:
        A new BeamBagStateHandler