Class KeyAccountingUnit<K>

java.lang.Object
org.apache.flink.runtime.asyncprocessing.KeyAccountingUnit<K>
Type Parameters:
K - the type of key

public class KeyAccountingUnit<K> extends Object
Key accounting unit holds the current in-flight key and tracks the corresponding ongoing records, which is used to preserve the ordering of independent chained StateFuture.
  • Constructor Details

    • KeyAccountingUnit

      public KeyAccountingUnit(int initCapacity)
  • Method Details

    • occupy

      public boolean occupy(Object record, K key)
      Occupy a key for processing, the subsequent records with the same key would be blocked until the previous key release.
      Returns:
      true if no one is occupying this key, and this record succeeds to take it.
    • release

      public void release(Object record, K key)
      Release a key, which is invoked when a RecordContext is released.
    • occupiedCount

      @VisibleForTesting public int occupiedCount()