Class StreamOperatorStateHandler


  • @Internal
    public class StreamOperatorStateHandler
    extends Object
    Class encapsulating various state backend handling logic for StreamOperator implementations.
    • Field Detail

      • LOG

        protected static final org.slf4j.Logger LOG
    • Constructor Detail

      • StreamOperatorStateHandler

        public StreamOperatorStateHandler​(StreamOperatorStateContext context,
                                          org.apache.flink.api.common.ExecutionConfig executionConfig,
                                          org.apache.flink.core.fs.CloseableRegistry closeableRegistry)
    • Method Detail

      • prepareCanonicalSavepoint

        @Nonnull
        public static org.apache.flink.runtime.state.SnapshotStrategyRunner<org.apache.flink.runtime.state.KeyedStateHandle,​? extends org.apache.flink.runtime.state.FullSnapshotResources<?>> prepareCanonicalSavepoint​(org.apache.flink.runtime.state.CheckpointableKeyedStateBackend<?> keyedStateBackend,
                                                                                                                                                                                                                               org.apache.flink.core.fs.CloseableRegistry closeableRegistry)
                                                                                                                                                                                                                        throws Exception
        Throws:
        Exception
      • notifyCheckpointComplete

        public void notifyCheckpointComplete​(long checkpointId)
                                      throws Exception
        Throws:
        Exception
      • notifyCheckpointAborted

        public void notifyCheckpointAborted​(long checkpointId)
                                     throws Exception
        Throws:
        Exception
      • getKeyedStateBackend

        public <K> org.apache.flink.runtime.state.KeyedStateBackend<K> getKeyedStateBackend()
      • getAsyncKeyedStateBackend

        @Nullable
        public org.apache.flink.runtime.state.AsyncKeyedStateBackend getAsyncKeyedStateBackend()
      • getOperatorStateBackend

        public org.apache.flink.runtime.state.OperatorStateBackend getOperatorStateBackend()
      • getOrCreateKeyedState

        public <N,​S extends org.apache.flink.api.common.state.State,​T> S getOrCreateKeyedState​(org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
                                                                                                           org.apache.flink.api.common.state.StateDescriptor<S,​T> stateDescriptor)
                                                                                                    throws Exception
        Throws:
        Exception
      • getPartitionedState

        protected <S extends org.apache.flink.api.common.state.State,​N> S getPartitionedState​(N namespace,
                                                                                                    org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
                                                                                                    org.apache.flink.api.common.state.StateDescriptor<S,​?> stateDescriptor)
                                                                                             throws Exception
        Creates a partitioned state handle, using the state backend configured for this task.
        Throws:
        IllegalStateException - Thrown, if the key/value state was already initialized.
        Exception - Thrown, if the state backend cannot create the key/value state.
      • setCurrentKey

        public void setCurrentKey​(Object key)
      • getCurrentKey

        public Object getCurrentKey()
      • getKeyedStateStore

        public Optional<org.apache.flink.api.common.state.KeyedStateStore> getKeyedStateStore()
      • getKeyedStateStoreV2

        public Optional<org.apache.flink.runtime.state.v2.KeyedStateStoreV2> getKeyedStateStoreV2()