public static final class RecordMakers.RecordsForCollection extends Object
| Modifier and Type | Field and Description |
|---|---|
private CollectionId |
collectionId |
private boolean |
emitTombstonesOnDelete |
private FieldSelector.FieldFilter |
fieldFilter |
private org.apache.kafka.connect.data.Schema |
keySchema |
private BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> |
recorder |
private String |
replicaSetName |
private SourceInfo |
source |
private Map<String,?> |
sourcePartition |
private String |
topicName |
private org.apache.kafka.connect.data.Schema |
valueSchema |
private Function<org.bson.Document,String> |
valueTransformer |
| Modifier | Constructor and Description |
|---|---|
protected |
RecordsForCollection(CollectionId collectionId,
FieldSelector.FieldFilter fieldFilter,
SourceInfo source,
String topicName,
SchemaNameAdjuster adjuster,
Function<org.bson.Document,String> valueTransformer,
BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder,
boolean emitTombstonesOnDelete) |
| Modifier and Type | Method and Description |
|---|---|
CollectionId |
collectionId()
Get the identifier of the collection to which this producer applies.
|
protected int |
createRecords(org.apache.kafka.connect.data.Struct source,
Map<String,?> offset,
Envelope.Operation operation,
String objId,
org.bson.Document objectValue,
Instant timestamp) |
protected String |
idObjToJson(Object idObj) |
protected org.apache.kafka.connect.data.Struct |
keyFor(String objId) |
int |
recordEvent(org.bson.Document oplogEvent,
org.bson.Document masterEvent,
Instant timestamp,
long txOrder)
Generate and record one or more source records to describe the given event.
|
int |
recordEvent(org.bson.Document oplogEvent,
Instant timestamp)
Generate and record one or more source records to describe the given event.
|
int |
recordObject(CollectionId id,
org.bson.Document object,
Instant timestamp)
Generate and record one or more source records to describe the given object.
|
private final CollectionId collectionId
private final String replicaSetName
private final FieldSelector.FieldFilter fieldFilter
private final SourceInfo source
private final String topicName
private final org.apache.kafka.connect.data.Schema keySchema
private final org.apache.kafka.connect.data.Schema valueSchema
private final BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder
private final boolean emitTombstonesOnDelete
protected RecordsForCollection(CollectionId collectionId, FieldSelector.FieldFilter fieldFilter, SourceInfo source, String topicName, SchemaNameAdjuster adjuster, Function<org.bson.Document,String> valueTransformer, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder, boolean emitTombstonesOnDelete)
public CollectionId collectionId()
public int recordObject(CollectionId id, org.bson.Document object, Instant timestamp) throws InterruptedException
id - the identifier of the collection in which the document exists; may not be nullobject - the document; may not be nulltimestamp - the timestamp at which this operation is occurringInterruptedException - if the calling thread was interrupted while waiting to submit a record to
the blocking consumerpublic int recordEvent(org.bson.Document oplogEvent,
org.bson.Document masterEvent,
Instant timestamp,
long txOrder)
throws InterruptedException
oplogEvent - the event; may not be nullmasterEvent - the event that contains metadata; same as oplogEvent for non-transactional changestimestamp - the timestamp at which this operation is occurringtxOrder - order of event in transaction; 0 for non-transactional eventInterruptedException - if the calling thread was interrupted while waiting to submit a record to
the blocking consumerpublic int recordEvent(org.bson.Document oplogEvent,
Instant timestamp)
throws InterruptedException
oplogEvent - the event; may not be nulltimestamp - the timestamp at which this operation is occurringInterruptedException - if the calling thread was interrupted while waiting to submit a record to
the blocking consumerprotected int createRecords(org.apache.kafka.connect.data.Struct source,
Map<String,?> offset,
Envelope.Operation operation,
String objId,
org.bson.Document objectValue,
Instant timestamp)
throws InterruptedException
InterruptedExceptionprotected org.apache.kafka.connect.data.Struct keyFor(String objId)
Copyright © 2020 JBoss by Red Hat. All rights reserved.