public class AvroEventDeserializer extends Object implements EventDeserializer
| Modifier and Type | Class and Description |
|---|---|
static class |
AvroEventDeserializer.AvroSchemaType |
static class |
AvroEventDeserializer.Builder |
| Modifier and Type | Field and Description |
|---|---|
static String |
AVRO_SCHEMA_HEADER_HASH |
static String |
AVRO_SCHEMA_HEADER_LITERAL |
static String |
CONFIG_SCHEMA_TYPE_KEY |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Calls
EventDeserializer.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
EventDeserializer.mark() was never previously called. |
public static final String CONFIG_SCHEMA_TYPE_KEY
public static final String AVRO_SCHEMA_HEADER_HASH
public static final String AVRO_SCHEMA_HEADER_LITERAL
public Event readEvent() throws IOException
EventDeserializerreadEvent in interface EventDeserializernull if no events could be read.IOExceptionEventDeserializer.mark(),
EventDeserializer.reset()public List<Event> readEvents(int numEvents) throws IOException
EventDeserializerreadEvents in interface EventDeserializernumEvents - Maximum number of events to return.IOExceptionEventDeserializer.mark(),
EventDeserializer.reset()public void mark()
throws IOException
EventDeserializermark in interface EventDeserializermark in interface ResettableIOExceptionEventDeserializer.reset()public void reset()
throws IOException
EventDeserializerEventDeserializer.mark() was never previously called. This should
be done in the case of inability to commit previously-deserialized events.reset in interface EventDeserializerreset in interface ResettableIOExceptionEventDeserializer.mark()public void close()
throws IOException
EventDeserializerEventDeserializer.reset() on the stream and then closes it.
In the case of successful completion of event consumption,
EventDeserializer.mark() MUST be called before close().close in interface Closeableclose in interface AutoCloseableclose in interface EventDeserializerIOExceptionEventDeserializer.mark(),
EventDeserializer.reset()Copyright © 2009-2022 Apache Software Foundation. All Rights Reserved.