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 Description JsonRecordHiveMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.hive.hcatalog.streaming.RecordWritercreateRecordWriter(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.JsonRecordHiveMapperwithColumnFields(Fields columnFields)JsonRecordHiveMapperwithPartitionFields(Fields partitionFields)JsonRecordHiveMapperwithTimeAsPartitionField(String timeFormat)voidwrite(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch, Tuple tuple)
-
-
-
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, ClassNotFoundExceptionDescription copied from interface:HiveMapperGiven a endPoint, returns a RecordWriter with columnNames.- Specified by:
createRecordWriterin interfaceHiveMapper- Throws:
org.apache.hive.hcatalog.streaming.StreamingExceptionIOExceptionClassNotFoundException
-
write
public void write(org.apache.hive.hcatalog.streaming.TransactionBatch txnBatch, Tuple tuple) throws org.apache.hive.hcatalog.streaming.StreamingException, IOException, InterruptedException- Specified by:
writein interfaceHiveMapper- Throws:
org.apache.hive.hcatalog.streaming.StreamingExceptionIOExceptionInterruptedException
-
mapPartitions
public List<String> mapPartitions(Tuple tuple)
Description copied from interface:HiveMapperGiven a tuple, return a hive partition values list.- Specified by:
mapPartitionsin interfaceHiveMapper
-
mapPartitions
public List<String> mapPartitions(TridentTuple tuple)
Description copied from interface:HiveMapperGiven a TridetnTuple, return a hive partition values list.- Specified by:
mapPartitionsin interfaceHiveMapper
-
mapRecord
public byte[] mapRecord(Tuple tuple)
Description copied from interface:HiveMapperGiven a tuple, maps to a HiveRecord based on columnFields.- Specified by:
mapRecordin interfaceHiveMapper
-
mapRecord
public byte[] mapRecord(TridentTuple tuple)
Description copied from interface:HiveMapperGiven a TridentTuple, maps to a HiveRecord based on columnFields.- Specified by:
mapRecordin interfaceHiveMapper
-
-