K
- the type of keypublic class KeyAccountingUnit<K> extends Object
StateFuture
.Constructor and Description |
---|
KeyAccountingUnit(int initCapacity) |
Modifier and Type | Method and 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 a
RecordContext is released. |
public boolean occupy(Object record, K key)
public void release(Object record, K key)
RecordContext
is released.@VisibleForTesting public int occupiedCount()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.