|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.flume.serialization.AvroEventDeserializer
public class AvroEventDeserializer
A deserializer that parses Avro container files, generating one Flume event per record in the Avro file, and storing binary avro-encoded records in the Flume event body.
Nested Class Summary | |
---|---|
static class |
AvroEventDeserializer.AvroSchemaType
|
static class |
AvroEventDeserializer.Builder
|
Field Summary | |
---|---|
static String |
AVRO_SCHEMA_HEADER_HASH
|
static String |
AVRO_SCHEMA_HEADER_LITERAL
|
static String |
CONFIG_SCHEMA_TYPE_KEY
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONFIG_SCHEMA_TYPE_KEY
public static final String AVRO_SCHEMA_HEADER_HASH
public static final String AVRO_SCHEMA_HEADER_LITERAL
Method Detail |
---|
public Event readEvent() throws IOException
EventDeserializer
readEvent
in interface EventDeserializer
null
if no events could be read.
IOException
EventDeserializer.mark()
,
EventDeserializer.reset()
public List<Event> readEvents(int numEvents) throws IOException
EventDeserializer
readEvents
in interface EventDeserializer
numEvents
- Maximum number of events to return.
IOException
EventDeserializer.mark()
,
EventDeserializer.reset()
public void mark() throws IOException
EventDeserializer
mark
in interface EventDeserializer
mark
in interface Resettable
IOException
EventDeserializer.reset()
public void reset() throws IOException
EventDeserializer
EventDeserializer.mark()
was never previously called. This should
be done in the case of inability to commit previously-deserialized events.
reset
in interface EventDeserializer
reset
in interface Resettable
IOException
EventDeserializer.mark()
public void close() throws IOException
EventDeserializer
EventDeserializer.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 Closeable
close
in interface EventDeserializer
IOException
EventDeserializer.mark()
,
EventDeserializer.reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |