org.apache.flume.source
Class AvroSource
java.lang.Object
org.apache.flume.source.AbstractSource
org.apache.flume.source.AvroSource
- All Implemented Interfaces:
- Configurable, EventDrivenSource, LifecycleAware, NamedComponent, Source, AvroSourceProtocol
public class AvroSource
- extends AbstractSource
- implements EventDrivenSource, Configurable, AvroSourceProtocol
A Source implementation that receives Avro events from clients that
implement AvroSourceProtocol.
This source forms one half of Flume's tiered collection support. Internally,
this source uses Avro's NettyTransceiver to listen for, and handle
events. It can be paired with the builtin AvroSink to create tiered
collection topologies. Of course, nothing prevents one from using this source
to receive data from other custom built infrastructure that uses the same
Avro protocol (specifically AvroSourceProtocol).
Events may be received from the client either singly or in batches.Generally,
larger batches are far more efficient, but introduce a slight delay (measured
in millis) in delivery. A batch submitted to the configured Channel
atomically (i.e. either all events make it into the channel or none).
Configuration options
| Parameter |
Description |
Unit / Type |
Default |
| bind |
The hostname or IP to which the source will bind. |
Hostname or IP / String |
none (required) |
| port |
The port to which the source will bind and listen for events. |
TCP port / int |
none (required) |
Metrics
TODO
AvroSource
public AvroSource()
configure
public void configure(Context context)
- Specified by:
configure in interface Configurable
start
public void start()
- Description copied from interface:
LifecycleAware
Starts a service or component.
Implementations should determine the result of any start logic and effect
the return value of LifecycleAware.getLifecycleState() accordingly.
- Specified by:
start in interface LifecycleAware- Overrides:
start in class AbstractSource
stop
public void stop()
- Description copied from interface:
LifecycleAware
Stops a service or component.
Implementations should determine the result of any stop logic and effect
the return value of LifecycleAware.getLifecycleState() accordingly.
- Specified by:
stop in interface LifecycleAware- Overrides:
stop in class AbstractSource
toString
public String toString()
- Overrides:
toString in class Object
append
public Status append(AvroFlumeEvent avroEvent)
- Specified by:
append in interface AvroSourceProtocol
appendBatch
public Status appendBatch(List<AvroFlumeEvent> events)
- Specified by:
appendBatch in interface AvroSourceProtocol
Copyright © 2009-2012 Apache Software Foundation. All Rights Reserved.