Class KeyAccountingUnit<K>
java.lang.Object
org.apache.flink.runtime.asyncprocessing.KeyAccountingUnit<K>
- Type Parameters:
K- the type of key
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanOccupy a key for processing, the subsequent records with the same key would be blocked until the previous key release.voidRelease a key, which is invoked when aRecordContextis released.
-
Constructor Details
-
KeyAccountingUnit
public KeyAccountingUnit(int initCapacity)
-
-
Method Details
-
occupy
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
Release a key, which is invoked when aRecordContextis released. -
occupiedCount
@VisibleForTesting public int occupiedCount()
-