Class WaitNotifyProtocol.Signal

java.lang.Object
org.apache.nifi.processors.standard.WaitNotifyProtocol.Signal
Enclosing class:
WaitNotifyProtocol

public static class WaitNotifyProtocol.Signal extends Object
  • Field Details

  • Constructor Details

    • Signal

      public Signal()
  • Method Details

    • getCounts

      public Map<String,Long> getCounts()
    • setCounts

      public void setCounts(Map<String,Long> counts)
    • getAttributes

      public Map<String,String> getAttributes()
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
    • getTotalCount

      public long getTotalCount()
    • isTotalCountReached

      public boolean isTotalCountReached(long targetCount)
    • isCountReached

      public boolean isCountReached(String counterName, long targetCount)
    • getCount

      public long getCount(String counterName)
    • getReleasableCount

      public long getReleasableCount()
    • setReleasableCount

      public void setReleasableCount(long releasableCount)
    • releaseCandidates

      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.

      Type Parameters:
      E - Type of candidate
      Parameters:
      counterName - 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.