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) |
StreamTaskStateInitializerImpl(Environment environment,
StateBackend stateBackend,
SubTaskInitializationMetricsBuilder initializationMetrics,
TtlTimeProvider ttlTimeProvider,
InternalTimeServiceManager.Provider timeServiceManagerProvider,
StreamTaskCancellationContext cancellationContext) |
public StreamTaskStateInitializerImpl(Environment environment, StateBackend stateBackend)
public StreamTaskStateInitializerImpl(Environment environment, StateBackend stateBackend, SubTaskInitializationMetricsBuilder initializationMetrics, TtlTimeProvider ttlTimeProvider, InternalTimeServiceManager.Provider timeServiceManagerProvider, StreamTaskCancellationContext cancellationContext)
public StreamOperatorStateContext streamOperatorStateContext(@Nonnull OperatorID operatorID, @Nonnull String operatorClassName, @Nonnull ProcessingTimeService processingTimeService, @Nonnull KeyContext keyContext, @Nullable TypeSerializer<?> keySerializer, @Nonnull CloseableRegistry streamTaskCloseableRegistry, @Nonnull MetricGroup metricGroup, double managedMemoryFraction, boolean isUsingCustomRawKeyedState) 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.metricGroup
- the parent metric group for all statebackend metricsmanagedMemoryFraction
- the managed memory fraction of the operator for state backendisUsingCustomRawKeyedState
- flag indicating whether or not the AbstractStreamOperator
is writing custom raw keyed state.Exception
- when something went wrong while creating the context.protected OperatorStateBackend operatorStateBackend(String operatorIdentifierText, PrioritizedOperatorSubtaskState prioritizedOperatorSubtaskStates, CloseableRegistry backendCloseableRegistry, StateObject.StateObjectSizeStatsCollector statsCollector) throws Exception
Exception
protected <K> CheckpointableKeyedStateBackend<K> keyedStatedBackend(TypeSerializer<K> keySerializer, String operatorIdentifierText, PrioritizedOperatorSubtaskState prioritizedOperatorSubtaskStates, CloseableRegistry backendCloseableRegistry, MetricGroup metricGroup, double managedMemoryFraction, StateObject.StateObjectSizeStatsCollector statsCollector) throws Exception
Exception
protected CloseableIterable<StatePartitionStreamProvider> rawOperatorStateInputs(@Nonnull Iterator<StateObjectCollection<OperatorStateHandle>> restoreStateAlternatives, @Nonnull StateObject.StateObjectSizeStatsCollector statsCollector)
protected CloseableIterable<KeyGroupStatePartitionStreamProvider> rawKeyedStateInputs(@Nonnull Iterator<StateObjectCollection<KeyedStateHandle>> restoreStateAlternatives, @Nonnull StateObject.StateObjectSizeStatsCollector statsCollector)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.