Class KeyAndTopicPartitionRecordGrouper

  • All Implemented Interfaces:
    RecordGrouper

    public final class KeyAndTopicPartitionRecordGrouper
    extends java.lang.Object
    implements RecordGrouper
    A RecordGrouper that groups records by topic, parition and key.

    The class requires a filename template with key variable declared and supports optional topic and partition variables declared.

    The class supports one record per file.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear all records.
      void put​(org.apache.kafka.connect.sink.SinkRecord record)
      Associate the record with the appropriate file.
      java.util.Map<java.lang.String,​java.util.List<org.apache.kafka.connect.sink.SinkRecord>> records()
      Get all records associated with files, grouped by the file name.
      • Methods inherited from class java.lang.Object

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

      • KeyAndTopicPartitionRecordGrouper

        public KeyAndTopicPartitionRecordGrouper​(Template filenameTemplate)
        A constructor.
        Parameters:
        filenameTemplate - the filename template.
    • Method Detail

      • put

        public void put​(org.apache.kafka.connect.sink.SinkRecord record)
        Description copied from interface: RecordGrouper
        Associate the record with the appropriate file.
        Specified by:
        put in interface RecordGrouper
        Parameters:
        record - - record to group
      • records

        public java.util.Map<java.lang.String,​java.util.List<org.apache.kafka.connect.sink.SinkRecord>> records()
        Description copied from interface: RecordGrouper
        Get all records associated with files, grouped by the file name.
        Specified by:
        records in interface RecordGrouper
        Returns:
        map of records assotiated with files