Class BeamStateRequestHandler
- java.lang.Object
-
- org.apache.flink.streaming.api.runners.python.beam.state.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.
-
-
Constructor Summary
Constructors Constructor Description BeamStateRequestHandler(BeamStateStore keyedStateStore, BeamStateStore operatorStateStore, BeamStateHandler<org.apache.flink.api.common.state.ListState<byte[]>> bagStateHandler, BeamStateHandler<org.apache.flink.api.common.state.MapState<ByteArrayWrapper,byte[]>> mapStateHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleRequest.CacheToken>getCacheTokens()CompletionStage<org.apache.beam.model.fnexecution.v1.BeamFnApi.StateResponse.Builder>handle(org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest request)static BeamStateRequestHandlerof(org.apache.flink.runtime.state.KeyedStateBackend<?> keyedStateBackend, org.apache.flink.runtime.state.OperatorStateBackend operatorStateBackend, org.apache.flink.api.common.typeutils.TypeSerializer<?> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<?> namespaceSerializer, org.apache.flink.configuration.ReadableConfig config)Create aBeamStateRequestHandler.
-
-
-
Constructor Detail
-
BeamStateRequestHandler
public BeamStateRequestHandler(BeamStateStore keyedStateStore, BeamStateStore operatorStateStore, BeamStateHandler<org.apache.flink.api.common.state.ListState<byte[]>> bagStateHandler, BeamStateHandler<org.apache.flink.api.common.state.MapState<ByteArrayWrapper,byte[]>> mapStateHandler)
-
-
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:
handlein interfaceorg.apache.beam.runners.fnexecution.state.StateRequestHandler- Throws:
Exception
-
getCacheTokens
public Iterable<org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleRequest.CacheToken> getCacheTokens()
- Specified by:
getCacheTokensin interfaceorg.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)
Create aBeamStateRequestHandler.- Parameters:
keyedStateBackend- if null,BeamStateRequestHandlerwould throw an error when receive keyed-state requests.operatorStateBackend- if null,BeamStateRequestHandlerwould throw an error when receive operator-state requests.keySerializer- key serializer forKeyedStateBackend, must not be null ifkeyedStatedBackendis not null.namespaceSerializer- namespace serializer forKeyedStateBackend, could be null when there's no window logic involved.config- state-related configurations- Returns:
- A new
BeamBagStateHandler
-
-