org.apache.flume.sink.hbase

## Class SimpleHbaseEventSerializer

- java.lang.Object
- - org.apache.flume.sink.hbase.SimpleHbaseEventSerializer

- All Implemented Interfaces:
    Configurable, ConfigurableComponent, HbaseEventSerializer

      public class SimpleHbaseEventSerializer
      extends Object
      implements HbaseEventSerializer

  A simple serializer 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 null: `payloadColumn:` Which column to put payload in. If it is null, event data will not be written.

  `incColumn:` Which column to increment. Null means no column is incremented.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SimpleHbaseEventSerializer.KeyType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleHbaseEventSerializer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `configure(ComponentConfiguration conf)`
    `void` | `configure(Context context)` Request the implementing class to (re)configure itself.
    `List<org.apache.hadoop.hbase.client.Row>` | `getActions()` Get the actions that should be written out to hbase as a result of this event.
    `List<org.apache.hadoop.hbase.client.Increment>` | `getIncrements()`
    `void` | `initialize(Event event, byte[] cf)` Initialize the event serializer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleHbaseEventSerializer

          public SimpleHbaseEventSerializer()

  - ### 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 guarantees on when configure might be called.

      Specified by:
        `configure` in interface `Configurable`

    - #### configure

          public void configure(ComponentConfiguration conf)

      Specified by:
        `configure` in interface `ConfigurableComponent`

    - #### initialize

          public void initialize(Event event,
                        byte[] cf)

      Description copied from interface: `HbaseEventSerializer`
      Initialize the event serializer.
      Specified by:
        `initialize` in interface `HbaseEventSerializer`
      Parameters:
        `event` - Event to be written to HBase
        `cf` - Column family to write to

    - #### getActions

          public List<org.apache.hadoop.hbase.client.Row> getActions()
                                                              throws FlumeException

      Description copied from interface: `HbaseEventSerializer`
      Get the actions that should be written out to hbase as a result of this event. This list is written to hbase using the HBase batch API.
      Specified by:
        `getActions` in interface `HbaseEventSerializer`
      Returns:
        List of `Row` which are written as such to HBase. 0.92 increments do not implement Row, so this is not generic.
      Throws:
        `FlumeException`

    - #### getIncrements

          public List<org.apache.hadoop.hbase.client.Increment> getIncrements()

      Specified by:
        `getIncrements` in interface `HbaseEventSerializer`

    - #### close

          public void close()

      Specified by:
        `close` in interface `HbaseEventSerializer`

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