Package io.debezium.data
Class SourceRecordStats
java.lang.Object
io.debezium.data.SourceRecordStats
- All Implemented Interfaces:
Consumer<org.apache.kafka.connect.source.SourceRecord>
public class SourceRecordStats
extends Object
implements Consumer<org.apache.kafka.connect.source.SourceRecord>
Statistics of
SourceRecords.- Author:
- Randall Hauch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicLongprivate final EnumMap<io.debezium.data.Envelope.Operation,AtomicLong> private final AtomicLong -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.apache.kafka.connect.source.SourceRecord record) longnumberOf(io.debezium.data.Envelope.Operation op) Get the number ofaddedrecords that had the givenEnvelope.Operation.longGet the number ofCREATErecords that wereaddedto this object.longGet the number ofDELETErecords that wereaddedto this object.longGet the number ofREADrecords that wereaddedto this object.longGet the number of tombstone records that wereaddedto this object.longGet the number ofUPDATErecords that wereaddedto this object.reset()Reset all of the counters to 0.toString()
-
Field Details
-
EMPTY
-
statsByOperation
-
tombstones
-
-
Constructor Details
-
SourceRecordStats
public SourceRecordStats()Create a new statistics object.
-
-
Method Details
-
accept
public void accept(org.apache.kafka.connect.source.SourceRecord record) -
numberOf
public long numberOf(io.debezium.data.Envelope.Operation op) Get the number ofaddedrecords that had the givenEnvelope.Operation.- Parameters:
op- the operation for which the record count is to be returned- Returns:
- the count; never negative
-
numberOfCreates
public long numberOfCreates()Get the number ofCREATErecords that wereaddedto this object.- Returns:
- the count; never negative
-
numberOfDeletes
public long numberOfDeletes()Get the number ofDELETErecords that wereaddedto this object.- Returns:
- the count; never negative
-
numberOfReads
public long numberOfReads()Get the number ofREADrecords that wereaddedto this object.- Returns:
- the count; never negative
-
numberOfUpdates
public long numberOfUpdates()Get the number ofUPDATErecords that wereaddedto this object.- Returns:
- the count; never negative
-
numberOfTombstones
public long numberOfTombstones()Get the number of tombstone records that wereaddedto this object.- Returns:
- the count; never negative
-
reset
Reset all of the counters to 0.- Returns:
- this object for method chaining purposes; never null
-
toString
-