T
- the upstream value typeI
- the type that indicates where the first cached item should be read fromA
- the accumulator type used to collect up partial dataR
- the output typepublic interface PartialCollectEmitter<T,I,A,R>
Modifier and Type | Method and Description |
---|---|
void |
cleanupItem(T item)
Call the cleanup handler of the operator for a specific upstream
instance.
|
void |
complete()
Indicate that no further output items will be produced.
|
long |
demand()
Returns the number of items that can be emitted via
next(Object)
without overflowing the downstream. |
void |
dropItems(int count)
Remove the first
count items from the cache, sending them
to the cleanup handler of the operator as well as possibly
triggering more requests to the upstream to replenish the buffer. |
A |
getAccumulator()
Returns an optional, user-defined accumulator that can be used to aggregate
partial items from upstream until enough data has been gathered.
|
I |
getIndex()
Reads an optional, user-defined index that can be used to store a read pointer into
the very first upstream item accessible via
getItem(int) to
indicate from where to resume. |
T |
getItem(int index)
Access a cached item based on an index less than
size() . |
boolean |
isCancelled()
The downstream requested cancellation.
|
boolean |
isComplete()
The upstream completed sending new items.
|
void |
next(R item)
Signal the next output item.
|
void |
setAccumulator(A newAccumulator)
Sets an optional, user-defined accumulator that can be used to aggregate
partial items from upstream.
|
void |
setIndex(I newIndex)
Sets an optional, user-defined index that can be used as a read poitner into
the very first upstream item.
|
int |
size()
The number of items cached and accessible via
getItem(int) . |
boolean isCancelled()
boolean isComplete()
int size()
getItem(int)
.T getItem(int index)
size()
.index
- the indexvoid dropItems(int count)
count
items from the cache, sending them
to the cleanup handler of the operator as well as possibly
triggering more requests to the upstream to replenish the buffer.count
- the number of items to dropI getIndex()
getItem(int)
to
indicate from where to resume.void setIndex(I newIndex)
newIndex
- the index object to setA getAccumulator()
void setAccumulator(A newAccumulator)
newAccumulator
- the new accumulator objectvoid next(R item)
This can be called as many times as demand()
.
item
- the item to signalvoid complete()
void cleanupItem(T item)
item
- the item to clean uplong demand()
next(Object)
without overflowing the downstream.