Class KeyRecordGrouper
java.lang.Object
io.aiven.kafka.connect.common.grouper.KeyRecordGrouper
- All Implemented Interfaces:
RecordGrouper
A
RecordGrouper that groups records by key.
The class requires a filename template with key variable declared.
The class supports one record per file.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.aiven.kafka.connect.common.grouper.RecordGrouper
RecordGrouper.Rotator<T> -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
KeyRecordGrouper
A constructor.- Parameters:
filenameTemplate- the filename template.
-
-
Method Details
-
put
public void put(org.apache.kafka.connect.sink.SinkRecord record) Description copied from interface:RecordGrouperAssociate the record with the appropriate file.- Specified by:
putin interfaceRecordGrouper- Parameters:
record- - record to group
-
clear
public void clear()Description copied from interface:RecordGrouperClear all records.- Specified by:
clearin interfaceRecordGrouper
-
records
Description copied from interface:RecordGrouperGet all records associated with files, grouped by the file name.- Specified by:
recordsin interfaceRecordGrouper- Returns:
- map of records assotiated with files
-