public static class WaitNotifyProtocol.Signal extends Object
| Modifier and Type | Field and Description |
|---|---|
private Map<String,String> |
attributes |
private AtomicCacheEntry<String,String,Object> |
cachedEntry |
private Map<String,Long> |
counts |
private String |
identifier |
private int |
releasableCount |
| Constructor and Description |
|---|
Signal() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getAttributes() |
long |
getCount(String counterName) |
Map<String,Long> |
getCounts() |
int |
getReleasableCount() |
long |
getTotalCount() |
boolean |
isCountReached(String counterName,
long targetCount) |
boolean |
isTotalCountReached(long targetCount) |
<E> void |
releaseCandidates(String counterName,
long requiredCountForPass,
int releasableCandidateCountPerPass,
List<E> candidates,
Consumer<List<E>> released,
Consumer<List<E>> waiting)
Consume accumulated notification signals to let some waiting candidates get released.
|
void |
setAttributes(Map<String,String> attributes) |
void |
setCounts(Map<String,Long> counts) |
void |
setReleasableCount(int releasableCount) |
private transient String identifier
private transient AtomicCacheEntry<String,String,Object> cachedEntry
private int releasableCount
public long getTotalCount()
public boolean isTotalCountReached(long targetCount)
public boolean isCountReached(String counterName, long targetCount)
public long getCount(String counterName)
public int getReleasableCount()
public void setReleasableCount(int releasableCount)
public <E> void releaseCandidates(String counterName, long requiredCountForPass, int releasableCandidateCountPerPass, List<E> candidates, Consumer<List<E>> released, Consumer<List<E>> waiting)
Consume accumulated notification signals to let some waiting candidates get released.
This method updates state of this instance, but does not update cache storage.
Caller of this method is responsible for updating cache storage after processing released and waiting candidates
by calling WaitNotifyProtocol.replace(Signal). Caller should rollback what it processed with these candidates if complete call failed.
E - Type of candidatecounterName - signal counter name to consume from. If not specified, total counter is used, and 'consumed' counter is added to subtract consumed counters from total counter.requiredCountForPass - number of required signals to acquire a pass.releasableCandidateCountPerPass - number of releasable candidate per pass.candidates - candidates waiting for being allowed to pass.released - function to process allowed candidates to pass.waiting - function to process candidates those should remain in waiting queue.Copyright © 2023 Apache NiFi Project. All rights reserved.