Package io.debezium.connector.mysql
Class MySqlStreamingChangeEventSourceMetrics
java.lang.Object
io.debezium.metrics.Metrics
io.debezium.pipeline.metrics.PipelineMetrics<P>
io.debezium.pipeline.metrics.DefaultStreamingChangeEventSourceMetrics<MySqlPartition>
io.debezium.connector.mysql.MySqlStreamingChangeEventSourceMetrics
- All Implemented Interfaces:
MySqlStreamingChangeEventSourceMetricsMXBean,ChangeEventSourceMetrics<MySqlPartition>,ChangeEventSourceMetricsMXBean,StreamingChangeEventSourceMetrics<MySqlPartition>,StreamingChangeEventSourceMetricsMXBean,CommonEventMetricsMXBean,ConnectionMetricsMXBean,QueueMetricsMXBean,SchemaMetricsMXBean,StreamingMetricsMXBean,DataChangeEventListener<MySqlPartition>,StreamingProgressListener
public class MySqlStreamingChangeEventSourceMetrics
extends DefaultStreamingChangeEventSourceMetrics<MySqlPartition>
implements MySqlStreamingChangeEventSourceMetricsMXBean
- Author:
- Randall Hauch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.github.shyiko.mysql.binlog.BinaryLogClientprivate final AtomicBooleanprivate final AtomicReference<String>private final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final MySqlDatabaseSchemaprivate final com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatisticsFields inherited from class io.debezium.pipeline.metrics.PipelineMetrics
metadataProvider, taskContext -
Constructor Summary
ConstructorsConstructorDescriptionMySqlStreamingChangeEventSourceMetrics(MySqlTaskContext taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider) -
Method Summary
Modifier and TypeMethodDescriptionName of the current MySQL binlog file being read by underlying mysql-binlog-client.longCurrent MySQL binlog offset position being read by underlying mysql-binlog-client.String[]Current MySQL Gtid being read by underlying mysql-binlog-client.booleanTracks if the connector is running using Gtids to track current offset.longlonglongTracks the number of committed transactions.longTracks the number of times the underlying mysql-binlog-client has been disconnected from MySQL.longTracks the number of transaction which contains events that contained more entries than could be contained within the connectors instance.longTracks the number of transactions which are not well-formed.longTracks the number of rolled back transactions.longTracks the number of events skipped by underlying mysql-binlog-client, generally due to the client being unable to properly deserialize the event.longbooleanvoidvoidonGtidChange(String gtid) voidvoidvoidvoidreset()voidsetIsGtidModeEnabled(boolean enabled) voidsetMilliSecondsBehindSource(long value) Methods inherited from class io.debezium.pipeline.metrics.DefaultStreamingChangeEventSourceMetrics
connected, onConnectorEvent, onEventMethods inherited from class io.debezium.pipeline.metrics.PipelineMetrics
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, getTotalNumberOfCreateEventsSeen, getTotalNumberOfDeleteEventsSeen, getTotalNumberOfUpdateEventsSeen, onErroneousEvent, onErroneousEvent, onFilteredEvent, onFilteredEventMethods inherited from class io.debezium.metrics.Metrics
metricName, metricName, register, unregisterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.pipeline.metrics.ChangeEventSourceMetrics
register, unregisterMethods inherited from interface io.debezium.pipeline.metrics.traits.CommonEventMetricsMXBean
getNumberOfErroneousEvents, getNumberOfEventsFiltered, getTotalNumberOfCreateEventsSeen, getTotalNumberOfDeleteEventsSeen, getTotalNumberOfUpdateEventsSeenMethods inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
onErroneousEvent, onErroneousEvent, onFilteredEvent, onFilteredEventMethods inherited from interface io.debezium.pipeline.metrics.traits.QueueMetricsMXBean
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getQueueRemainingCapacity, getQueueTotalCapacity
-
Field Details
-
client
private final com.github.shyiko.mysql.binlog.BinaryLogClient client -
stats
private final com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics stats -
schema
-
numberOfCommittedTransactions
-
numberOfRolledBackTransactions
-
numberOfNotWellFormedTransactions
-
numberOfLargeTransactions
-
isGtidModeEnabled
-
milliSecondsBehindMaster
-
lastTransactionId
-
-
Constructor Details
-
MySqlStreamingChangeEventSourceMetrics
public MySqlStreamingChangeEventSourceMetrics(MySqlTaskContext taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
-
Method Details
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceConnectionMetricsMXBean- Overrides:
isConnectedin classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-
getBinlogFilename
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanName of the current MySQL binlog file being read by underlying mysql-binlog-client.- Specified by:
getBinlogFilenamein interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getBinlogPosition
public long getBinlogPosition()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanCurrent MySQL binlog offset position being read by underlying mysql-binlog-client.- Specified by:
getBinlogPositionin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getGtidSet
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanCurrent MySQL Gtid being read by underlying mysql-binlog-client.- Specified by:
getGtidSetin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getIsGtidModeEnabled
public boolean getIsGtidModeEnabled()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks if the connector is running using Gtids to track current offset.- Specified by:
getIsGtidModeEnabledin interfaceMySqlStreamingChangeEventSourceMetricsMXBean- Returns:
- true if using Gtids, false if not.
-
getLastEvent
- Specified by:
getLastEventin interfaceCommonEventMetricsMXBean- Overrides:
getLastEventin classPipelineMetrics<MySqlPartition>
-
getMilliSecondsSinceLastEvent
public long getMilliSecondsSinceLastEvent()- Specified by:
getMilliSecondsSinceLastEventin interfaceCommonEventMetricsMXBean- Overrides:
getMilliSecondsSinceLastEventin classPipelineMetrics<MySqlPartition>
-
getTotalNumberOfEventsSeen
public long getTotalNumberOfEventsSeen()- Specified by:
getTotalNumberOfEventsSeenin interfaceCommonEventMetricsMXBean- Overrides:
getTotalNumberOfEventsSeenin classPipelineMetrics<MySqlPartition>
-
getNumberOfSkippedEvents
public long getNumberOfSkippedEvents()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks the number of events skipped by underlying mysql-binlog-client, generally due to the client being unable to properly deserialize the event.- Specified by:
getNumberOfSkippedEventsin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getNumberOfDisconnects
public long getNumberOfDisconnects()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks the number of times the underlying mysql-binlog-client has been disconnected from MySQL.- Specified by:
getNumberOfDisconnectsin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
reset
public void reset()- Specified by:
resetin interfaceChangeEventSourceMetricsMXBean- Overrides:
resetin classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks the number of committed transactions.- Specified by:
getNumberOfCommittedTransactionsin interfaceMySqlStreamingChangeEventSourceMetricsMXBean- Specified by:
getNumberOfCommittedTransactionsin interfaceStreamingMetricsMXBean- Overrides:
getNumberOfCommittedTransactionsin classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-
getNumberOfRolledBackTransactions
public long getNumberOfRolledBackTransactions()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks the number of rolled back transactions.- Specified by:
getNumberOfRolledBackTransactionsin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getNumberOfNotWellFormedTransactions
public long getNumberOfNotWellFormedTransactions()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks the number of transactions which are not well-formed. Example - The connector sees a commit TX event without a matched begin TX event.- Specified by:
getNumberOfNotWellFormedTransactionsin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getNumberOfLargeTransactions
public long getNumberOfLargeTransactions()Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBeanTracks the number of transaction which contains events that contained more entries than could be contained within the connectors instance.- Specified by:
getNumberOfLargeTransactionsin interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
onCommittedTransaction
public void onCommittedTransaction() -
onRolledBackTransaction
public void onRolledBackTransaction() -
onNotWellFormedTransaction
public void onNotWellFormedTransaction() -
onLargeTransaction
public void onLargeTransaction() -
onGtidChange
-
setIsGtidModeEnabled
public void setIsGtidModeEnabled(boolean enabled) -
setMilliSecondsBehindSource
public void setMilliSecondsBehindSource(long value) -
getCapturedTables
- Specified by:
getCapturedTablesin interfaceSchemaMetricsMXBean- Overrides:
getCapturedTablesin classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-
getMilliSecondsBehindSource
public long getMilliSecondsBehindSource()- Specified by:
getMilliSecondsBehindSourcein interfaceStreamingMetricsMXBean- Overrides:
getMilliSecondsBehindSourcein classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-
getSourceEventPosition
- Specified by:
getSourceEventPositionin interfaceStreamingMetricsMXBean- Overrides:
getSourceEventPositionin classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-
getLastTransactionId
- Specified by:
getLastTransactionIdin interfaceStreamingMetricsMXBean- Overrides:
getLastTransactionIdin classDefaultStreamingChangeEventSourceMetrics<MySqlPartition>
-