@ThreadSafe public class RecordMakers extends Object
SourceRecords for collections and submits them to a consumer.| Modifier and Type | Class and Description |
|---|---|
static class |
RecordMakers.RecordsForCollection
A record producer for a given collection.
|
| Modifier and Type | Field and Description |
|---|---|
private boolean |
emitTombstonesOnDelete |
private static com.mongodb.util.ObjectSerializer |
jsonSerializer |
private org.slf4j.Logger |
logger |
private static Map<String,Envelope.Operation> |
operationLiterals |
private BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> |
recorder |
private Map<CollectionId,RecordMakers.RecordsForCollection> |
recordMakerByCollectionId |
private SchemaNameAdjuster |
schemaNameAdjuster |
private SourceInfo |
source |
private TopicSelector |
topicSelector |
private Function<org.bson.Document,String> |
valueTransformer |
| Constructor and Description |
|---|
RecordMakers(SourceInfo source,
TopicSelector topicSelector,
BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder,
boolean emitTombstonesOnDelete)
Create the record makers using the supplied components.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all of the cached record makers.
|
RecordMakers.RecordsForCollection |
forCollection(CollectionId collectionId)
Obtain the record maker for the given table, using the specified columns and sending records to the given consumer.
|
private static final com.mongodb.util.ObjectSerializer jsonSerializer
private static final Map<String,Envelope.Operation> operationLiterals
private final org.slf4j.Logger logger
private final SchemaNameAdjuster schemaNameAdjuster
private final SourceInfo source
private final TopicSelector topicSelector
private final Map<CollectionId,RecordMakers.RecordsForCollection> recordMakerByCollectionId
private final BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder
private final boolean emitTombstonesOnDelete
public RecordMakers(SourceInfo source, TopicSelector topicSelector, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder, boolean emitTombstonesOnDelete)
source - the connector's source information; may not be nulltopicSelector - the selector for topic names; may not be nullrecorder - the potentially blocking consumer function to be called for each generated record; may not be nullpublic RecordMakers.RecordsForCollection forCollection(CollectionId collectionId)
collectionId - the identifier of the collection for which records are to be produced; may not be nullpublic void clear()
Copyright © 2018 JBoss by Red Hat. All rights reserved.