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 chainedStateFuture
.
-
-
Constructor Summary
Constructors Constructor Description KeyAccountingUnit(int initCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
occupiedCount()
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.void
release(Object record, K key)
Release a key, which is invoked when aRecordContext
is released.
-
-
-
Method Detail
-
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 aRecordContext
is released.
-
occupiedCount
@VisibleForTesting public int occupiedCount()
-
-