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

      • notifyCheckpointComplete

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

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

        public <K> org.apache.flink.api.common.typeutils.TypeSerializer<K> getKeySerializer()
      • 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
      • getOrCreateKeyedState

        public <N,​S extends org.apache.flink.api.common.state.v2.State,​T> S getOrCreateKeyedState​(N defaultNamespace,
                                                                                                              org.apache.flink.api.common.typeutils.TypeSerializer<N> namespaceSerializer,
                                                                                                              org.apache.flink.api.common.state.v2.StateDescriptor<T> stateDescriptor)
                                                                                                       throws Exception
        Create new state (v2) based on new state descriptor.
        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()