org.apache.flume.sink.hbase
Class SimpleAsyncHbaseEventSerializer

java.lang.Object
  extended by org.apache.flume.sink.hbase.SimpleAsyncHbaseEventSerializer
All Implemented Interfaces:
Configurable, ConfigurableComponent, AsyncHbaseEventSerializer

public class SimpleAsyncHbaseEventSerializer
extends Object
implements AsyncHbaseEventSerializer

A simple serializer to be used with the AsyncHBaseSink that returns puts from an event, by writing the event body into it. The headers are discarded. It also updates a row in hbase which acts as an event counter. Takes optional parameters:

rowPrefix: The prefix to be used. Default: default

incrementRow The row to increment. Default: incRow

suffix: uuid/random/timestamp.Default: uuid

Mandatory parameters:

cf:Column family.

Components that have no defaults and will not be used if absent: payloadColumn: Which column to put payload in. If it is not present, event data will not be written.

incrementColumn: Which column to increment. If this is absent, it means no column is incremented.


Constructor Summary
SimpleAsyncHbaseEventSerializer()
           
 
Method Summary
 void cleanUp()
          Clean up any state.
 void configure(ComponentConfiguration conf)
           
 void configure(Context context)
           Request the implementing class to (re)configure itself.
 List<org.hbase.async.PutRequest> getActions()
          Get the actions that should be written out to hbase as a result of this event.
 List<org.hbase.async.AtomicIncrementRequest> getIncrements()
          Get the increments that should be made in hbase as a result of this event.
 void initialize(byte[] table, byte[] cf)
          Initialize the event serializer.
 void setEvent(Event event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleAsyncHbaseEventSerializer

public SimpleAsyncHbaseEventSerializer()
Method Detail

initialize

public void initialize(byte[] table,
                       byte[] cf)
Description copied from interface: AsyncHbaseEventSerializer
Initialize the event serializer.

Specified by:
initialize in interface AsyncHbaseEventSerializer
Parameters:
table - - The table the serializer should use when creating PutRequest or AtomicIncrementRequest.
cf - - The column family to be used.

getActions

public List<org.hbase.async.PutRequest> getActions()
Description copied from interface: AsyncHbaseEventSerializer
Get the actions that should be written out to hbase as a result of this event. This list is written to hbase.

Specified by:
getActions in interface AsyncHbaseEventSerializer
Returns:
List of PutRequest which are written as such to HBase.

getIncrements

public List<org.hbase.async.AtomicIncrementRequest> getIncrements()
Description copied from interface: AsyncHbaseEventSerializer
Get the increments that should be made in hbase as a result of this event. This list is written to hbase.

Specified by:
getIncrements in interface AsyncHbaseEventSerializer
Returns:
List of AtomicIncrementRequest which are written as such to HBase.

cleanUp

public void cleanUp()
Description copied from interface: AsyncHbaseEventSerializer
Clean up any state. This will be called when the sink is being stopped.

Specified by:
cleanUp in interface AsyncHbaseEventSerializer

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

setEvent

public void setEvent(Event event)
Specified by:
setEvent in interface AsyncHbaseEventSerializer

configure

public void configure(ComponentConfiguration conf)
Specified by:
configure in interface ConfigurableComponent


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