org.apache.storm.hive.bolt.mapper

## Class JsonRecordHiveMapper

- java.lang.Object
- - org.apache.storm.hive.bolt.mapper.JsonRecordHiveMapper

- All Implemented Interfaces:
    Serializable, HiveMapper

      public class JsonRecordHiveMapper
      extends Object
      implements HiveMapper

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JsonRecordHiveMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.hive.hcatalog.streaming.RecordWriter` | `createRecordWriter(org.apache.hive.hcatalog.streaming.HiveEndPoint endPoint)` Given a endPoint, returns a RecordWriter with columnNames.
    `List<String>` | `mapPartitions(TridentTuple tuple)` Given a TridetnTuple, return a hive partition values list.
    `List<String>` | `mapPartitions(Tuple tuple)` Given a tuple, return a hive partition values list.
    `byte[]` | `mapRecord(TridentTuple tuple)` Given a TridentTuple, maps to a HiveRecord based on columnFields.
    `byte[]` | `mapRecord(Tuple tuple)` Given a tuple, maps to a HiveRecord based on columnFields.
    `JsonRecordHiveMapper` | `withColumnFields(Fields columnFields)`
    `JsonRecordHiveMapper` | `withPartitionFields(Fields partitionFields)`
    `JsonRecordHiveMapper` | `withTimeAsPartitionField(String timeFormat)`
    `void` | `write(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch, Tuple tuple)`

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

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

- - ### Constructor Detail

    - #### JsonRecordHiveMapper

          public JsonRecordHiveMapper()

  - ### Method Detail

    - #### withColumnFields

          public JsonRecordHiveMapper withColumnFields(Fields columnFields)

    - #### withPartitionFields

          public JsonRecordHiveMapper withPartitionFields(Fields partitionFields)

    - #### withTimeAsPartitionField

          public JsonRecordHiveMapper withTimeAsPartitionField(String timeFormat)

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

      Description copied from interface: `HiveMapper`

      Given a endPoint, returns a RecordWriter with columnNames.

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

    - #### write

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

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

    - #### mapPartitions

          public List<String> mapPartitions(Tuple tuple)

      Description copied from interface: `HiveMapper`

      Given a tuple, return a hive partition values list.

      Specified by:
        `mapPartitions` in interface `HiveMapper`

    - #### mapPartitions

          public List<String> mapPartitions(TridentTuple tuple)

      Description copied from interface: `HiveMapper`

      Given a TridetnTuple, return a hive partition values list.

      Specified by:
        `mapPartitions` in interface `HiveMapper`

    - #### mapRecord

          public byte[] mapRecord(Tuple tuple)

      Description copied from interface: `HiveMapper`

      Given a tuple, maps to a HiveRecord based on columnFields.

      Specified by:
        `mapRecord` in interface `HiveMapper`

    - #### mapRecord

          public byte[] mapRecord(TridentTuple tuple)

      Description copied from interface: `HiveMapper`

      Given a TridentTuple, maps to a HiveRecord based on columnFields.

      Specified by:
        `mapRecord` in interface `HiveMapper`

Copyright © 2021 The Apache Software Foundation. All rights reserved.