Class 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 Detail

      • statsByOperation

        private final EnumMap<io.debezium.data.Envelope.Operation,​AtomicLong> statsByOperation
    • Constructor Detail

      • SourceRecordStats

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

      • 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