@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 Filters |
filters |
private static com.mongodb.util.ObjectSerializer |
jsonSerializer |
private org.slf4j.Logger |
logger |
private static Map<String,Envelope.Operation> |
OPERATION_LITERALS |
private BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> |
recorder |
private Map<CollectionId,RecordMakers.RecordsForCollection> |
recordMakerByCollectionId |
private SchemaNameAdjuster |
schemaNameAdjuster |
private SourceInfo |
source |
private TopicSelector<CollectionId> |
topicSelector |
private Function<org.bson.Document,String> |
valueTransformer |
| Constructor and Description |
|---|
RecordMakers(Filters filters,
SourceInfo source,
TopicSelector<CollectionId> 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.
|
static boolean |
isValidOperation(String operation) |
private static final com.mongodb.util.ObjectSerializer jsonSerializer
@ThreadSafe private static final Map<String,Envelope.Operation> OPERATION_LITERALS
private final org.slf4j.Logger logger
private final SchemaNameAdjuster schemaNameAdjuster
private final Filters filters
private final SourceInfo source
private final TopicSelector<CollectionId> topicSelector
private final Map<CollectionId,RecordMakers.RecordsForCollection> recordMakerByCollectionId
private final BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder
private final boolean emitTombstonesOnDelete
public RecordMakers(Filters filters, SourceInfo source, TopicSelector<CollectionId> topicSelector, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder, boolean emitTombstonesOnDelete)
filters - the filter configuration; may not be nullsource - 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 static boolean isValidOperation(String operation)
public void clear()
Copyright © 2020 JBoss by Red Hat. All rights reserved.