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 Details

    • EMPTY

      private final AtomicLong EMPTY
    • statsByOperation

      private final EnumMap<io.debezium.data.Envelope.Operation,AtomicLong> statsByOperation
    • tombstones

      private final AtomicLong tombstones
  • Constructor Details

    • SourceRecordStats

      public SourceRecordStats()
      Create a new statistics object.
  • Method Details

    • accept

      public void accept(org.apache.kafka.connect.source.SourceRecord record)
      Specified by:
      accept in interface Consumer<org.apache.kafka.connect.source.SourceRecord>
    • numberOf

      public long numberOf(io.debezium.data.Envelope.Operation op)
      Get the number of added records that had the given Envelope.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 of CREATE records that were added to this object.
      Returns:
      the count; never negative
    • numberOfDeletes

      public long numberOfDeletes()
      Get the number of DELETE records that were added to this object.
      Returns:
      the count; never negative
    • numberOfReads

      public long numberOfReads()
      Get the number of READ records that were added to this object.
      Returns:
      the count; never negative
    • numberOfUpdates

      public long numberOfUpdates()
      Get the number of UPDATE records that were added to this object.
      Returns:
      the count; never negative
    • numberOfTombstones

      public long numberOfTombstones()
      Get the number of tombstone records that were added to this object.
      Returns:
      the count; never negative
    • reset

      public SourceRecordStats reset()
      Reset all of the counters to 0.
      Returns:
      this object for method chaining purposes; never null
    • toString

      public String toString()
      Overrides:
      toString in class Object