org.apache.flume.sink.kite.parser
Class AvroParser
java.lang.Object
org.apache.flume.sink.kite.parser.AvroParser
- All Implemented Interfaces:
- EntityParser<org.apache.avro.generic.GenericRecord>
public class AvroParser
- extends Object
- implements EntityParser<org.apache.avro.generic.GenericRecord>
An EntityParser
that parses Avro serialized bytes from an event.
The Avro schema used to serialize the data should be set as either a URL
or literal in the flume.avro.schema.url or flume.avro.schema.literal event
headers respectively.
Method Summary |
org.apache.avro.generic.GenericRecord |
parse(Event event,
org.apache.avro.generic.GenericRecord reuse)
Parse the entity from the body of the given event. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parse
public org.apache.avro.generic.GenericRecord parse(Event event,
org.apache.avro.generic.GenericRecord reuse)
throws EventDeliveryException,
NonRecoverableEventException
- Parse the entity from the body of the given event.
- Specified by:
parse
in interface EntityParser<org.apache.avro.generic.GenericRecord>
- Parameters:
event
- The event to parse.reuse
- If non-null, this may be reused and returned from this method.
- Returns:
- The parsed entity as a GenericRecord.
- Throws:
EventDeliveryException
- A recoverable error such as an error
downloading the schema from the URL has
occurred.
NonRecoverableEventException
- A non-recoverable error such as an
unparsable schema or entity has
occurred.
Copyright © 2009-2015 Apache Software Foundation. All Rights Reserved.