org.apache.flume.sink.hive

## Class HiveJsonSerializer

- java.lang.Object
- - org.apache.flume.sink.hive.HiveJsonSerializer

- All Implemented Interfaces:
    Configurable, HiveEventSerializer

      public class HiveJsonSerializer
      extends Object
      implements HiveEventSerializer

  Forwards the incoming event body to Hive unmodified Sets up the delimiter and the field to column mapping

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ALIAS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HiveJsonSerializer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configure(Context context)` Request the implementing class to (re)configure itself.
    `org.apache.hive.hcatalog.streaming.RecordWriter` | `createRecordWriter(org.apache.hive.hcatalog.streaming.HiveEndPoint endPoint)`
    `void` | `write(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch, Collection<byte[]> events)`
    `void` | `write(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch, Event e)`

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

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

- - ### Field Detail

    - #### ALIAS

          public static final String ALIAS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HiveJsonSerializer

          public HiveJsonSerializer()

  - ### Method Detail

    - #### write

          public void write(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch,
                   Event e)
                     throws org.apache.hive.hcatalog.streaming.StreamingException,
                            IOException,
                            InterruptedException

      Specified by:
        `write` in interface `HiveEventSerializer`
      Throws:
        `org.apache.hive.hcatalog.streaming.StreamingException`
        `IOException`
        `InterruptedException`

    - #### write

          public void write(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch,
                   Collection<byte[]> events)
                     throws org.apache.hive.hcatalog.streaming.StreamingException,
                            IOException,
                            InterruptedException

      Specified by:
        `write` in interface `HiveEventSerializer`
      Throws:
        `org.apache.hive.hcatalog.streaming.StreamingException`
        `IOException`
        `InterruptedException`

    - #### createRecordWriter

          public org.apache.hive.hcatalog.streaming.RecordWriter createRecordWriter(org.apache.hive.hcatalog.streaming.HiveEndPoint endPoint)
                                                                             throws org.apache.hive.hcatalog.streaming.StreamingException,
                                                                                    IOException,
                                                                                    ClassNotFoundException

      Specified by:
        `createRecordWriter` in interface `HiveEventSerializer`
      Throws:
        `org.apache.hive.hcatalog.streaming.StreamingException`
        `IOException`
        `ClassNotFoundException`

    - #### 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`

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