Class YieldingAccumulator<AccumulatedType,InType>

java.lang.Object
org.apache.druid.java.util.common.guava.YieldingAccumulator<AccumulatedType,InType>
Direct Known Subclasses:
DelegatingYieldingAccumulator, FilteringYieldingAccumulator, MappingYieldingAccumulator

public abstract class YieldingAccumulator<AccumulatedType,InType> extends Object
A YieldingAccumulator is used along with a Yielder in order to replicate continuations in Java. I'm still not sure this is such a great idea, but it's there. We shall see. The accumulated has its accumulate() method called and has the option of "yielding" its response by calling yield() before returning as response. If it chooses not to yield its response, then it expects to get called again with the next value and the value it just returned.
  • Constructor Details

    • YieldingAccumulator

      public YieldingAccumulator()
  • Method Details

    • yield

      public void yield()
    • yielded

      public boolean yielded()
    • reset

      public void reset()
    • accumulate

      public abstract AccumulatedType accumulate(AccumulatedType accumulated, InType in)