Class ChangelogKeyGroupedPriorityQueue<T>

java.lang.Object
org.apache.flink.state.changelog.ChangelogKeyGroupedPriorityQueue<T>
All Implemented Interfaces:
org.apache.flink.runtime.state.InternalPriorityQueue<T>, org.apache.flink.runtime.state.KeyGroupedInternalPriorityQueue<T>, ChangelogState

public class ChangelogKeyGroupedPriorityQueue<T> extends Object implements org.apache.flink.runtime.state.KeyGroupedInternalPriorityQueue<T>, ChangelogState
A KeyGroupedInternalPriorityQueue that keeps state on the underlying delegated KeyGroupedInternalPriorityQueue as well as on the state change log.
  • Constructor Details

    • ChangelogKeyGroupedPriorityQueue

      public ChangelogKeyGroupedPriorityQueue(org.apache.flink.runtime.state.KeyGroupedInternalPriorityQueue<T> delegatedPriorityQueue, StateChangeLogger<T,Void> logger, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
  • Method Details

    • getSubsetForKeyGroup

      public Set<T> getSubsetForKeyGroup(int keyGroupId)
      Specified by:
      getSubsetForKeyGroup in interface org.apache.flink.runtime.state.KeyGroupedInternalPriorityQueue<T>
    • poll

      @Nullable public T poll()
      Specified by:
      poll in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • peek

      @Nullable public T peek()
      Specified by:
      peek in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • add

      public boolean add(T toAdd)
      Specified by:
      add in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • remove

      public boolean remove(T toRemove)
      Specified by:
      remove in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • size

      public int size()
      Specified by:
      size in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • addAll

      public void addAll(@Nullable Collection<? extends T> toAdd)
      Specified by:
      addAll in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • iterator

      @Nonnull public org.apache.flink.util.CloseableIterator<T> iterator()
      Specified by:
      iterator in interface org.apache.flink.runtime.state.InternalPriorityQueue<T>
    • getChangeApplier

      public StateChangeApplier getChangeApplier(ChangelogApplierFactory factory)
      Specified by:
      getChangeApplier in interface ChangelogState
    • setDelegatedState

      public <IS> void setDelegatedState(IS state)
      Specified by:
      setDelegatedState in interface ChangelogState
    • getStateChangeLogger

      public StateChangeLogger<T,Void> getStateChangeLogger()
    • resetWritingMetaFlag

      public void resetWritingMetaFlag()
      Description copied from interface: ChangelogState
      Enable logging meta data before next writes.
      Specified by:
      resetWritingMetaFlag in interface ChangelogState