com.github.shyiko.mysql.binlog.jmx
Class BinaryLogClientStatistics

java.lang.Object
  extended by com.github.shyiko.mysql.binlog.jmx.BinaryLogClientStatistics
All Implemented Interfaces:
BinaryLogClient.EventListener, BinaryLogClient.LifecycleListener, BinaryLogClientStatisticsMXBean

public class BinaryLogClientStatistics
extends Object
implements BinaryLogClientStatisticsMXBean, BinaryLogClient.EventListener, BinaryLogClient.LifecycleListener

Author:
Stanley Shyiko

Constructor Summary
BinaryLogClientStatistics()
           
BinaryLogClientStatistics(BinaryLogClient binaryLogClient)
           
 
Method Summary
protected  long getCurrentTimeMillis()
           
 String getLastEvent()
           
 long getNumberOfDisconnects()
           
 long getNumberOfSkippedEvents()
           
 long getSecondsBehindMaster()
           
 long getSecondsSinceLastEvent()
           
 long getTotalNumberOfEventsSeen()
           
 void onCommunicationFailure(BinaryLogClient client, Exception ex)
          It's guarantied to be called before BinaryLogClient.LifecycleListener.onDisconnect(BinaryLogClient)) in case of communication failure.
 void onConnect(BinaryLogClient client)
          Called once client has successfully logged in but before started to receive binlog events.
 void onDisconnect(BinaryLogClient client)
          Called upon disconnect (regardless of the reason).
 void onEvent(Event event)
           
 void onEventDeserializationFailure(BinaryLogClient client, Exception ex)
          Called in case of failed event deserialization.
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryLogClientStatistics

public BinaryLogClientStatistics()

BinaryLogClientStatistics

public BinaryLogClientStatistics(BinaryLogClient binaryLogClient)
Method Detail

getLastEvent

public String getLastEvent()
Specified by:
getLastEvent in interface BinaryLogClientStatisticsMXBean

getSecondsSinceLastEvent

public long getSecondsSinceLastEvent()
Specified by:
getSecondsSinceLastEvent in interface BinaryLogClientStatisticsMXBean

getSecondsBehindMaster

public long getSecondsBehindMaster()
Specified by:
getSecondsBehindMaster in interface BinaryLogClientStatisticsMXBean

getTotalNumberOfEventsSeen

public long getTotalNumberOfEventsSeen()
Specified by:
getTotalNumberOfEventsSeen in interface BinaryLogClientStatisticsMXBean

getNumberOfSkippedEvents

public long getNumberOfSkippedEvents()
Specified by:
getNumberOfSkippedEvents in interface BinaryLogClientStatisticsMXBean

getNumberOfDisconnects

public long getNumberOfDisconnects()
Specified by:
getNumberOfDisconnects in interface BinaryLogClientStatisticsMXBean

reset

public void reset()
Specified by:
reset in interface BinaryLogClientStatisticsMXBean

onEvent

public void onEvent(Event event)
Specified by:
onEvent in interface BinaryLogClient.EventListener

onEventDeserializationFailure

public void onEventDeserializationFailure(BinaryLogClient client,
                                          Exception ex)
Description copied from interface: BinaryLogClient.LifecycleListener
Called in case of failed event deserialization. Note this type of error does NOT cause client to disconnect. If you wish to stop receiving events you'll need to fire client.disconnect() manually.

Specified by:
onEventDeserializationFailure in interface BinaryLogClient.LifecycleListener

onDisconnect

public void onDisconnect(BinaryLogClient client)
Description copied from interface: BinaryLogClient.LifecycleListener
Called upon disconnect (regardless of the reason).

Specified by:
onDisconnect in interface BinaryLogClient.LifecycleListener

onConnect

public void onConnect(BinaryLogClient client)
Description copied from interface: BinaryLogClient.LifecycleListener
Called once client has successfully logged in but before started to receive binlog events.

Specified by:
onConnect in interface BinaryLogClient.LifecycleListener

onCommunicationFailure

public void onCommunicationFailure(BinaryLogClient client,
                                   Exception ex)
Description copied from interface: BinaryLogClient.LifecycleListener
It's guarantied to be called before BinaryLogClient.LifecycleListener.onDisconnect(BinaryLogClient)) in case of communication failure.

Specified by:
onCommunicationFailure in interface BinaryLogClient.LifecycleListener

getCurrentTimeMillis

protected long getCurrentTimeMillis()


Copyright © 2015. All Rights Reserved.