Package io.pravega.common.concurrent
Class MultiKeyLatestItemSequentialProcessor<KeyType,ItemType>
- java.lang.Object
-
- io.pravega.common.concurrent.MultiKeyLatestItemSequentialProcessor<KeyType,ItemType>
-
- Type Parameters:
KeyType- The type of the key to be processed.ItemType- The type of item to be processed.
public class MultiKeyLatestItemSequentialProcessor<KeyType,ItemType> extends java.lang.ObjectProvides a way to run a function on Key Value Pairs but guarantees that the function is only invoked for one item at a time per key. If multiple 'updates' to a particular key are provided while the processor is running, only the most recent is passed to the function. This allows it to 'skip' updates for keys that are not the most recent value.
-
-
Constructor Summary
Constructors Constructor Description MultiKeyLatestItemSequentialProcessor(java.util.function.BiConsumer<KeyType,ItemType> processFunction, java.util.concurrent.Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidupdateItem(KeyType key, ItemType newItem)Updates the item and triggers it to be processed.
-