public static final class ReductionUtil.CollectorReduction<E,A,R> extends Object implements Reduction<R>
Reduction.DoubleReductionBuilder, Reduction.LongReductionBuilder, Reduction.ReductionBuilder<E>| Constructor and Description |
|---|
CollectorReduction(@NotNull DocumentExtractor<E> extractor,
@NotNull Collector<E,A,? extends R> collector) |
| Modifier and Type | Method and Description |
|---|---|
long |
accept(@NotNull MarshallableIn tailer)
Accepts the input of the provided
tailer and reduces (folds) the contents of it
into this Reduction returning the last seen index or -1 if no index was seen. |
void |
onExcerpt(@NotNull Wire wire,
long index)
Consumes an excerpt from the provided
wire at the index at the provided index. |
R |
reduction()
Returns a view of the underlying reduction.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitof, ofDouble, ofLongandThenpublic void onExcerpt(@NotNull
@NotNull Wire wire,
long index)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
Reductionwire at the index at the provided index.
If this method throws an Exception, it is relayed to the call site. Therefore, care should be taken to minimise the probability of throwing Exceptions.
If this method is referenced as an ExcerptListener then the Reduction must be
thread-safe.
onExcerpt in interface Reduction<R>onExcerpt in interface ExcerptListenerwire - representing access to the excerpt that was stored (non-null).index - in the queue where the except was placed (non-negative)net.openhft.chronicle.core.io.InvalidMarshallableException@NotNull public R reduction()
Reductionpublic long accept(@NotNull
@NotNull MarshallableIn tailer)
throws net.openhft.chronicle.core.io.InvalidMarshallableException
Reductiontailer and reduces (folds) the contents of it
into this Reduction returning the last seen index or -1 if no index was seen.
This method can be used to initialise a Reduction before appending new values.
It is the responsibility of the caller to make sure no simultaneous appenders are using this Reduction during the entire fold operation.
Copyright © 2023. All rights reserved.