public static final class RecordMakers.RecordsForCollection extends Object
| Modifier and Type | Field and Description |
|---|---|
private CollectionId |
collectionId |
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,
SourceInfo source,
String topicName,
AvroValidator validator,
Function<org.bson.Document,String> valueTransformer,
BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder) |
| 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,
long timestamp) |
protected org.apache.kafka.connect.data.Struct |
keyFor(String objId) |
protected String |
objectIdLiteral(Object id) |
protected String |
objectIdLiteralFrom(org.bson.Document obj) |
int |
recordEvent(org.bson.Document oplogEvent,
long timestamp)
Generate and record one or more source records to describe the given event.
|
int |
recordObject(CollectionId id,
org.bson.Document object,
long timestamp)
Generate and record one or more source records to describe the given object.
|
private final CollectionId collectionId
private final String replicaSetName
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
protected RecordsForCollection(CollectionId collectionId, SourceInfo source, String topicName, AvroValidator validator, Function<org.bson.Document,String> valueTransformer, BlockingConsumer<org.apache.kafka.connect.source.SourceRecord> recorder)
public CollectionId collectionId()
public int recordObject(CollectionId id, org.bson.Document object, long 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,
long 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,
long timestamp)
throws InterruptedException
InterruptedExceptionprotected String objectIdLiteralFrom(org.bson.Document obj)
protected org.apache.kafka.connect.data.Struct keyFor(String objId)
Copyright © 2017 JBoss by Red Hat. All rights reserved.