org.apache.flume.sink.solr.morphline
Class MorphlineHandlerImpl

java.lang.Object
  extended by org.apache.flume.sink.solr.morphline.MorphlineHandlerImpl
All Implemented Interfaces:
Configurable, MorphlineHandler

public class MorphlineHandlerImpl
extends Object
implements MorphlineHandler

A MorphlineHandler that processes it's events using a morphline Command chain.


Field Summary
static String MORPHLINE_FILE_PARAM
           
static String MORPHLINE_ID_PARAM
           
static String MORPHLINE_VARIABLE_PARAM
          Morphline variables can be passed from flume.conf to the morphline, e.g.: agent.sinks.solrSink.morphlineVariable.zkHost=127.0.0.1:2181/solr
 
Constructor Summary
MorphlineHandlerImpl()
           
 
Method Summary
 void beginTransaction()
          Begins a transaction
 void commitTransaction()
          Sends any outstanding documents to Solr and waits for a positive or negative ack (i.e.
 void configure(Context context)
           Request the implementing class to (re)configure itself.
 void process(Event event)
          Loads the given event into Solr
 void rollbackTransaction()
          Performs a rollback of all non-committed documents pending.
 void stop()
          Releases allocated resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MORPHLINE_FILE_PARAM

public static final String MORPHLINE_FILE_PARAM
See Also:
Constant Field Values

MORPHLINE_ID_PARAM

public static final String MORPHLINE_ID_PARAM
See Also:
Constant Field Values

MORPHLINE_VARIABLE_PARAM

public static final String MORPHLINE_VARIABLE_PARAM
Morphline variables can be passed from flume.conf to the morphline, e.g.: agent.sinks.solrSink.morphlineVariable.zkHost=127.0.0.1:2181/solr

See Also:
Constant Field Values
Constructor Detail

MorphlineHandlerImpl

public MorphlineHandlerImpl()
Method Detail

configure

public void configure(Context context)
Description copied from interface: Configurable

Request the implementing class to (re)configure itself.

When configuration parameters are changed, they must be reflected by the component asap.

There are no thread safety guarrantees on when configure might be called.

Specified by:
configure in interface Configurable

process

public void process(Event event)
Description copied from interface: MorphlineHandler
Loads the given event into Solr

Specified by:
process in interface MorphlineHandler

beginTransaction

public void beginTransaction()
Description copied from interface: MorphlineHandler
Begins a transaction

Specified by:
beginTransaction in interface MorphlineHandler

commitTransaction

public void commitTransaction()
Description copied from interface: MorphlineHandler
Sends any outstanding documents to Solr and waits for a positive or negative ack (i.e. exception). Depending on the outcome the caller should then commit or rollback the current flume transaction correspondingly.

Specified by:
commitTransaction in interface MorphlineHandler

rollbackTransaction

public void rollbackTransaction()
Description copied from interface: MorphlineHandler
Performs a rollback of all non-committed documents pending.

Note that this is not a true rollback as in databases. Content you have previously added to Solr may have already been committed due to autoCommit, buffer full, other client performing a commit etc. So this is only a best-effort rollback.

Specified by:
rollbackTransaction in interface MorphlineHandler

stop

public void stop()
Description copied from interface: MorphlineHandler
Releases allocated resources

Specified by:
stop in interface MorphlineHandler


Copyright © 2009-2013 Apache Software Foundation. All Rights Reserved.