Class MultiStateKeyIterator<K>

java.lang.Object
org.apache.flink.state.api.input.MultiStateKeyIterator<K>
Type Parameters:
K - Type of the key by which state is keyed.
All Implemented Interfaces:
AutoCloseable, Iterator<K>, org.apache.flink.util.CloseableIterator<K>

@Internal public final class MultiStateKeyIterator<K> extends Object implements org.apache.flink.util.CloseableIterator<K>
An iterator for reading all keys in a state backend across multiple partitioned states.

To read unique keys across all partitioned states callers must invoke remove().

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.flink.util.CloseableIterator

    org.apache.flink.util.CloseableIterator.IteratorAdapter<E extends Object>
  • Field Summary

    Fields inherited from interface org.apache.flink.util.CloseableIterator

    EMPTY_INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiStateKeyIterator(List<? extends org.apache.flink.api.common.state.StateDescriptor<?,?>> descriptors, org.apache.flink.runtime.state.KeyedStateBackend<K> backend)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
     
     
    void
    Removes the current key from ALL known states in the state backend.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Constructor Details

    • MultiStateKeyIterator

      public MultiStateKeyIterator(List<? extends org.apache.flink.api.common.state.StateDescriptor<?,?>> descriptors, org.apache.flink.runtime.state.KeyedStateBackend<K> backend)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<K>
    • next

      public K next()
      Specified by:
      next in interface Iterator<K>
    • remove

      public void remove()
      Removes the current key from ALL known states in the state backend.
      Specified by:
      remove in interface Iterator<K>
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception