public class StreamTaskStateInitializerImpl extends Object implements StreamTaskStateInitializer
StreamTaskStateInitializer
. This class obtains the state to create
StreamOperatorStateContext
objects for stream operators from the TaskStateManager
of the task that
runs the stream task and hence the operator.
This implementation operates on top a TaskStateManager
, from which it receives everything required to
restore state in the backends from checkpoints or savepoints.
Constructor and Description |
---|
StreamTaskStateInitializerImpl(Environment environment,
StateBackend stateBackend,
ProcessingTimeService processingTimeService) |
public StreamTaskStateInitializerImpl(Environment environment, StateBackend stateBackend, ProcessingTimeService processingTimeService)
public StreamOperatorStateContext streamOperatorStateContext(@Nonnull OperatorID operatorID, @Nonnull String operatorClassName, @Nonnull KeyContext keyContext, @Nullable TypeSerializer<?> keySerializer, @Nonnull CloseableRegistry streamTaskCloseableRegistry) throws Exception
StreamTaskStateInitializer
StreamOperatorStateContext
for an AbstractStreamOperator
that runs in the stream
task that owns this manager.streamOperatorStateContext
in interface StreamTaskStateInitializer
operatorID
- the id of the operator for which the context is created. Cannot be null.operatorClassName
- the classname of the operator instance for which the context is created. Cannot be null.keyContext
- the key context of the operator instance for which the context is created Cannot be null.keySerializer
- the key-serializer for the operator. Can be null.streamTaskCloseableRegistry
- the closeable registry to which created closeable objects will be registered.Exception
- when something went wrong while creating the context.protected <K> InternalTimeServiceManager<?,K> internalTimeServiceManager(AbstractKeyedStateBackend<K> keyedStatedBackend, KeyContext keyContext, Iterable<KeyGroupStatePartitionStreamProvider> rawKeyedStates) throws Exception
Exception
protected OperatorStateBackend operatorStateBackend(String operatorIdentifierText, PrioritizedOperatorSubtaskState prioritizedOperatorSubtaskStates, CloseableRegistry backendCloseableRegistry) throws Exception
Exception
protected <K> AbstractKeyedStateBackend<K> keyedStatedBackend(TypeSerializer<K> keySerializer, String operatorIdentifierText, PrioritizedOperatorSubtaskState prioritizedOperatorSubtaskStates, CloseableRegistry backendCloseableRegistry) throws Exception
Exception
protected CloseableIterable<StatePartitionStreamProvider> rawOperatorStateInputs(Iterator<StateObjectCollection<OperatorStateHandle>> restoreStateAlternatives)
protected CloseableIterable<KeyGroupStatePartitionStreamProvider> rawKeyedStateInputs(Iterator<StateObjectCollection<KeyedStateHandle>> restoreStateAlternatives)
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.