@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.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 AutoCloseable
close
in interface Closeable
IOException
mark()
,
reset()
Copyright © 2009-2016 Apache Software Foundation. All Rights Reserved.