@InterfaceAudience.Public @InterfaceStability.Evolving public interface EventDeserializer extends Resettable, Closeable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
EventDeserializer.Builder
Knows how to construct this deserializer.
Note: Implementations MUST provide a public a no-arg constructor. |
| Modifier and Type | Method and Description |
|---|---|
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. |
Event readEvent() throws IOException
null if no events could be read.IOExceptionmark(),
reset()List<Event> readEvents(int numEvents) throws IOException
numEvents - Maximum number of events to return.IOExceptionmark(),
reset()void mark() throws IOException
mark in interface ResettableIOExceptionreset()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 ResettableIOExceptionmark()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 AutoCloseableclose in interface CloseableIOExceptionmark(),
reset()Copyright © 2009-2022 Apache Software Foundation. All Rights Reserved.