Package io.debezium.connector.mysql
Class MySqlStreamingChangeEventSourceMetrics
- java.lang.Object
-
- io.debezium.metrics.Metrics
-
- io.debezium.pipeline.metrics.PipelineMetrics
-
- io.debezium.pipeline.metrics.StreamingChangeEventSourceMetrics
-
- io.debezium.connector.mysql.MySqlStreamingChangeEventSourceMetrics
-
- All Implemented Interfaces:
MySqlStreamingChangeEventSourceMetricsMXBean
,ChangeEventSourceMetricsMXBean
,StreamingChangeEventSourceMetricsMXBean
,DataChangeEventListener
public class MySqlStreamingChangeEventSourceMetrics extends StreamingChangeEventSourceMetrics implements MySqlStreamingChangeEventSourceMetricsMXBean
- Author:
- Randall Hauch
-
-
Field Summary
Fields Modifier and Type Field Description private com.github.shyiko.mysql.binlog.BinaryLogClient
client
private AtomicBoolean
isGtidModeEnabled
private AtomicReference<String>
lastTransactionId
private AtomicLong
milliSecondsBehindMaster
private AtomicLong
numberOfCommittedTransactions
private AtomicLong
numberOfLargeTransactions
private AtomicLong
numberOfNotWellFormedTransactions
private AtomicLong
numberOfRolledBackTransactions
private MySqlDatabaseSchema
schema
private com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics
stats
-
Fields inherited from class io.debezium.pipeline.metrics.PipelineMetrics
clock, lastEventTimestamp, metadataProvider, numberOfErroneousEvents, taskContext, totalNumberOfEventsSeen
-
Fields inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
NO_OP
-
-
Constructor Summary
Constructors Constructor Description MySqlStreamingChangeEventSourceMetrics(MySqlTaskContext taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBinlogFilename()
Name of the current MySQL binlog file being read by underlying mysql-binlog-client.long
getBinlogPosition()
Current MySQL binlog offset position being read by underlying mysql-binlog-client.String[]
getCapturedTables()
String
getGtidSet()
Current MySQL Gtid being read by underlying mysql-binlog-client.boolean
getIsGtidModeEnabled()
Tracks if the connector is running using Gtids to track current offset.String
getLastEvent()
String
getLastTransactionId()
long
getMilliSecondsBehindSource()
long
getMilliSecondsSinceLastEvent()
String[]
getMonitoredTables()
long
getNumberOfCommittedTransactions()
Tracks the number of committed transactions.long
getNumberOfDisconnects()
Tracks the number of times the underlying mysql-binlog-client has been disconnected from MySQL.long
getNumberOfLargeTransactions()
Tracks the number of transaction which contains events that contained more entries than could be contained within the connectors {@see io.debezium.connector.mysql.EventBuffer} instance.long
getNumberOfNotWellFormedTransactions()
Tracks the number of transactions which are not well-formed.long
getNumberOfRolledBackTransactions()
Tracks the number of rolled back transactions.long
getNumberOfSkippedEvents()
Tracks the number of events skipped by underlying mysql-binlog-client, generally due to the client being unable to properly deserialize the event.Map<String,String>
getSourceEventPosition()
long
getTotalNumberOfEventsSeen()
boolean
isConnected()
void
onCommittedTransaction()
void
onGtidChange(String gtid)
void
onLargeTransaction()
void
onNotWellFormedTransaction()
void
onRolledBackTransaction()
void
reset()
void
setIsGtidModeEnabled(boolean enabled)
void
setMilliSecondsBehindSource(long value)
-
Methods inherited from class io.debezium.pipeline.metrics.StreamingChangeEventSourceMetrics
connected, onConnectorEvent, onEvent
-
Methods inherited from class io.debezium.pipeline.metrics.PipelineMetrics
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity, onErroneousEvent, onFilteredEvent
-
Methods inherited from class io.debezium.metrics.Metrics
metricName, register, unregister
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.debezium.pipeline.metrics.ChangeEventSourceMetricsMXBean
getCurrentQueueSizeInBytes, getMaxQueueSizeInBytes, getNumberOfErroneousEvents, getNumberOfEventsFiltered, getQueueRemainingCapacity, getQueueTotalCapacity
-
Methods inherited from interface io.debezium.pipeline.source.spi.DataChangeEventListener
onErroneousEvent, onFilteredEvent
-
-
-
-
Field Detail
-
client
private final com.github.shyiko.mysql.binlog.BinaryLogClient client
-
stats
private final com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics stats
-
schema
private final MySqlDatabaseSchema schema
-
numberOfCommittedTransactions
private final AtomicLong numberOfCommittedTransactions
-
numberOfRolledBackTransactions
private final AtomicLong numberOfRolledBackTransactions
-
numberOfNotWellFormedTransactions
private final AtomicLong numberOfNotWellFormedTransactions
-
numberOfLargeTransactions
private final AtomicLong numberOfLargeTransactions
-
isGtidModeEnabled
private final AtomicBoolean isGtidModeEnabled
-
milliSecondsBehindMaster
private final AtomicLong milliSecondsBehindMaster
-
lastTransactionId
private final AtomicReference<String> lastTransactionId
-
-
Constructor Detail
-
MySqlStreamingChangeEventSourceMetrics
public MySqlStreamingChangeEventSourceMetrics(MySqlTaskContext taskContext, ChangeEventQueueMetrics changeEventQueueMetrics, EventMetadataProvider metadataProvider)
-
-
Method Detail
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceStreamingChangeEventSourceMetricsMXBean
- Overrides:
isConnected
in classStreamingChangeEventSourceMetrics
-
getBinlogFilename
public String getBinlogFilename()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Name of the current MySQL binlog file being read by underlying mysql-binlog-client.- Specified by:
getBinlogFilename
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getBinlogPosition
public long getBinlogPosition()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Current MySQL binlog offset position being read by underlying mysql-binlog-client.- Specified by:
getBinlogPosition
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getGtidSet
public String getGtidSet()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Current MySQL Gtid being read by underlying mysql-binlog-client.- Specified by:
getGtidSet
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getIsGtidModeEnabled
public boolean getIsGtidModeEnabled()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks if the connector is running using Gtids to track current offset.- Specified by:
getIsGtidModeEnabled
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
- Returns:
- true if using Gtids, false if not.
-
getLastEvent
public String getLastEvent()
- Specified by:
getLastEvent
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
getLastEvent
in classPipelineMetrics
-
getMilliSecondsSinceLastEvent
public long getMilliSecondsSinceLastEvent()
- Specified by:
getMilliSecondsSinceLastEvent
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
getMilliSecondsSinceLastEvent
in classPipelineMetrics
-
getTotalNumberOfEventsSeen
public long getTotalNumberOfEventsSeen()
- Specified by:
getTotalNumberOfEventsSeen
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
getTotalNumberOfEventsSeen
in classPipelineMetrics
-
getNumberOfSkippedEvents
public long getNumberOfSkippedEvents()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks the number of events skipped by underlying mysql-binlog-client, generally due to the client being unable to properly deserialize the event.- Specified by:
getNumberOfSkippedEvents
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getNumberOfDisconnects
public long getNumberOfDisconnects()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks the number of times the underlying mysql-binlog-client has been disconnected from MySQL.- Specified by:
getNumberOfDisconnects
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
reset
public void reset()
- Specified by:
reset
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
reset
in classStreamingChangeEventSourceMetrics
-
getNumberOfCommittedTransactions
public long getNumberOfCommittedTransactions()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks the number of committed transactions.- Specified by:
getNumberOfCommittedTransactions
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
- Specified by:
getNumberOfCommittedTransactions
in interfaceStreamingChangeEventSourceMetricsMXBean
- Overrides:
getNumberOfCommittedTransactions
in classStreamingChangeEventSourceMetrics
-
getNumberOfRolledBackTransactions
public long getNumberOfRolledBackTransactions()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks the number of rolled back transactions.- Specified by:
getNumberOfRolledBackTransactions
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getNumberOfNotWellFormedTransactions
public long getNumberOfNotWellFormedTransactions()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks 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:
getNumberOfNotWellFormedTransactions
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
getNumberOfLargeTransactions
public long getNumberOfLargeTransactions()
Description copied from interface:MySqlStreamingChangeEventSourceMetricsMXBean
Tracks the number of transaction which contains events that contained more entries than could be contained within the connectors {@see io.debezium.connector.mysql.EventBuffer} instance.- Specified by:
getNumberOfLargeTransactions
in interfaceMySqlStreamingChangeEventSourceMetricsMXBean
-
onCommittedTransaction
public void onCommittedTransaction()
-
onRolledBackTransaction
public void onRolledBackTransaction()
-
onNotWellFormedTransaction
public void onNotWellFormedTransaction()
-
onLargeTransaction
public void onLargeTransaction()
-
onGtidChange
public void onGtidChange(String gtid)
-
setIsGtidModeEnabled
public void setIsGtidModeEnabled(boolean enabled)
-
setMilliSecondsBehindSource
public void setMilliSecondsBehindSource(long value)
-
getMonitoredTables
public String[] getMonitoredTables()
- Specified by:
getMonitoredTables
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
getMonitoredTables
in classStreamingChangeEventSourceMetrics
-
getCapturedTables
public String[] getCapturedTables()
- Specified by:
getCapturedTables
in interfaceChangeEventSourceMetricsMXBean
- Overrides:
getCapturedTables
in classStreamingChangeEventSourceMetrics
-
getMilliSecondsBehindSource
public long getMilliSecondsBehindSource()
- Specified by:
getMilliSecondsBehindSource
in interfaceStreamingChangeEventSourceMetricsMXBean
- Overrides:
getMilliSecondsBehindSource
in classStreamingChangeEventSourceMetrics
-
getSourceEventPosition
public Map<String,String> getSourceEventPosition()
- Specified by:
getSourceEventPosition
in interfaceStreamingChangeEventSourceMetricsMXBean
- Overrides:
getSourceEventPosition
in classStreamingChangeEventSourceMetrics
-
getLastTransactionId
public String getLastTransactionId()
- Specified by:
getLastTransactionId
in interfaceStreamingChangeEventSourceMetricsMXBean
- Overrides:
getLastTransactionId
in classStreamingChangeEventSourceMetrics
-
-