Class KafkaRowConverterTest

  • All Implemented Interfaces:
    org.apache.calcite.adapter.kafka.KafkaRowConverter<java.lang.String,​java.lang.String>

    public class KafkaRowConverterTest
    extends java.lang.Object
    implements org.apache.calcite.adapter.kafka.KafkaRowConverter<java.lang.String,​java.lang.String>
    Implementation of KafkaRowConverter for test, both key and value are saved as byte[].
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.calcite.rel.type.RelDataType rowDataType​(java.lang.String topicName)
      Generate row schema for a given Kafka topic.
      java.lang.Object[] toRow​(org.apache.kafka.clients.consumer.ConsumerRecord<java.lang.String,​java.lang.String> message)
      Parse and reformat Kafka message from consumer, to fit with row schema defined as rowDataType(String).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KafkaRowConverterTest

        public KafkaRowConverterTest()
    • Method Detail

      • rowDataType

        public org.apache.calcite.rel.type.RelDataType rowDataType​(java.lang.String topicName)
        Generate row schema for a given Kafka topic.
        Specified by:
        rowDataType in interface org.apache.calcite.adapter.kafka.KafkaRowConverter<java.lang.String,​java.lang.String>
        Parameters:
        topicName - , Kafka topic name;
        Returns:
        row type
      • toRow

        public java.lang.Object[] toRow​(org.apache.kafka.clients.consumer.ConsumerRecord<java.lang.String,​java.lang.String> message)
        Parse and reformat Kafka message from consumer, to fit with row schema defined as rowDataType(String).
        Specified by:
        toRow in interface org.apache.calcite.adapter.kafka.KafkaRowConverter<java.lang.String,​java.lang.String>
        Parameters:
        message - , the raw Kafka message record;
        Returns:
        fields in the row