T
- The type of the events written to this segment.@Beta
public interface SegmentIterator<T>
extends java.util.Iterator<T>, java.lang.AutoCloseable
Iterator.next()
for each event in
the segment at the time of its creation. Once all the events that were in the segment at the time
of the creation of the SegmentIterator have been returned Iterator.hasNext()
will return false.
While buffering is used to avoid it, it is possible for Iterator.next()
to block on fetching the
data.
At any time getOffset()
can be called to get the byte offset in the segment the iterator
is currently pointing to.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the iterator, freeing any resources associated with it.
|
long |
getOffset()
Provides the current offset in the segment.
|