|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@InterfaceAudience.Public @InterfaceStability.Evolving public interface EventDeserializer
Establishes a contract for reading events stored in arbitrary formats from reliable, resettable streams.
Nested Class Summary | |
---|---|
static interface |
EventDeserializer.Builder
Knows how to construct this deserializer. Note: Implementations MUST provide a public a no-arg constructor. |
Method Summary | |
---|---|
void |
close()
Calls reset() on the stream and then closes it. |
void |
mark()
Marks the underlying input stream, indicating that the events previously returned by this EventDeserializer have been successfully committed. |
Event |
readEvent()
Read a single event from the underlying stream. |
List<Event> |
readEvents(int numEvents)
Read a batch of events from the underlying stream. |
void |
reset()
Resets the underlying input stream to the last known mark (or beginning of the stream if mark() was never previously called. |
Method Detail |
---|
Event readEvent() throws IOException
null
if no events could be read.
IOException
mark()
,
reset()
List<Event> readEvents(int numEvents) throws IOException
numEvents
- Maximum number of events to return.
IOException
mark()
,
reset()
void mark() throws IOException
mark
in interface Resettable
IOException
reset()
void reset() throws IOException
mark()
was never previously called. This should
be done in the case of inability to commit previously-deserialized events.
reset
in interface Resettable
IOException
mark()
void close() throws IOException
reset()
on the stream and then closes it.
In the case of successful completion of event consumption,
mark()
MUST be called before close()
.
close
in interface Closeable
IOException
mark()
,
reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |