public class BeamStateRequestHandler extends Object implements org.apache.beam.runners.fnexecution.state.StateRequestHandler
Constructor and Description |
---|
BeamStateRequestHandler(BeamStateStore keyedStateStore,
BeamStateStore operatorStateStore,
BeamStateHandler<ListState<byte[]>> bagStateHandler,
BeamStateHandler<MapState<ByteArrayWrapper,byte[]>> mapStateHandler) |
Modifier and Type | Method and 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 BeamStateRequestHandler |
of(KeyedStateBackend<?> keyedStateBackend,
OperatorStateBackend operatorStateBackend,
TypeSerializer<?> keySerializer,
TypeSerializer<?> namespaceSerializer,
ReadableConfig config)
Create a
BeamStateRequestHandler . |
public BeamStateRequestHandler(BeamStateStore keyedStateStore, BeamStateStore operatorStateStore, BeamStateHandler<ListState<byte[]>> bagStateHandler, BeamStateHandler<MapState<ByteArrayWrapper,byte[]>> mapStateHandler)
public CompletionStage<org.apache.beam.model.fnexecution.v1.BeamFnApi.StateResponse.Builder> handle(org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest request) throws Exception
handle
in interface org.apache.beam.runners.fnexecution.state.StateRequestHandler
Exception
public Iterable<org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleRequest.CacheToken> getCacheTokens()
getCacheTokens
in interface org.apache.beam.runners.fnexecution.state.StateRequestHandler
public static BeamStateRequestHandler of(@Nullable KeyedStateBackend<?> keyedStateBackend, @Nullable OperatorStateBackend operatorStateBackend, @Nullable TypeSerializer<?> keySerializer, @Nullable TypeSerializer<?> namespaceSerializer, ReadableConfig config)
BeamStateRequestHandler
.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 configurationsBeamBagStateHandler
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.