public class DatabaseHistoryMetrics extends Metrics implements DatabaseHistoryListener, DatabaseHistoryMXBean
DatabaseSchema
metrics.Modifier and Type | Class and Description |
---|---|
static class |
DatabaseHistoryMetrics.DatabaseHistoryStatus |
Modifier and Type | Field and Description |
---|---|
private AtomicLong |
changesRecovered |
private static String |
CONTEXT_NAME |
private HistoryRecord |
lastAppliedChange |
private Instant |
lastChangeAppliedTimestamp |
private Instant |
lastChangeRecoveredTimestamp |
private HistoryRecord |
lastRecoveredChange |
private static org.slf4j.Logger |
LOGGER |
private static Duration |
PAUSE_BETWEEN_LOG_MESSAGES |
private Instant |
recoveryStartTime |
private DatabaseHistoryMetrics.DatabaseHistoryStatus |
status |
private AtomicLong |
totalChangesApplied |
NOOP
Modifier | Constructor and Description |
---|---|
|
DatabaseHistoryMetrics(CommonConnectorConfig connectorConfig) |
protected |
DatabaseHistoryMetrics(T taskContext,
String contextName) |
Modifier and Type | Method and Description |
---|---|
long |
getChangesApplied() |
long |
getChangesRecovered() |
String |
getLastAppliedChange() |
String |
getLastRecoveredChange() |
long |
getMilliSecondsSinceLastAppliedChange() |
long |
getMilliSecondsSinceLastRecoveredChange() |
long |
getRecoveryStartTime() |
String |
getStatus()
The database history starts in
STOPPED state. |
void |
onChangeApplied(HistoryRecord record)
Invoked for every change applied and not filtered.
|
void |
onChangeFromHistory(HistoryRecord record)
Invoked for every change read from the history during recovery.
|
void |
recoveryStarted() |
void |
recoveryStopped() |
void |
started() |
void |
stopped() |
metricName, register, unregister
private static final String CONTEXT_NAME
private static final Duration PAUSE_BETWEEN_LOG_MESSAGES
private static final org.slf4j.Logger LOGGER
private DatabaseHistoryMetrics.DatabaseHistoryStatus status
private Instant recoveryStartTime
private AtomicLong changesRecovered
private AtomicLong totalChangesApplied
private Instant lastChangeAppliedTimestamp
private Instant lastChangeRecoveredTimestamp
private HistoryRecord lastAppliedChange
private HistoryRecord lastRecoveredChange
protected DatabaseHistoryMetrics(T taskContext, String contextName)
public DatabaseHistoryMetrics(CommonConnectorConfig connectorConfig)
public String getStatus()
DatabaseHistoryMXBean
STOPPED
state.
Upon start it transitions to RECOVERING
state.
When all changes from stored history were applied then it switches to RUNNING
state.
Maps to DatabaseHistoryMetrics.DatabaseHistoryStatus
enum.
getStatus
in interface DatabaseHistoryMXBean
public long getRecoveryStartTime()
getRecoveryStartTime
in interface DatabaseHistoryMXBean
public long getChangesRecovered()
getChangesRecovered
in interface DatabaseHistoryMXBean
public long getChangesApplied()
getChangesApplied
in interface DatabaseHistoryMXBean
public long getMilliSecondsSinceLastAppliedChange()
getMilliSecondsSinceLastAppliedChange
in interface DatabaseHistoryMXBean
public long getMilliSecondsSinceLastRecoveredChange()
getMilliSecondsSinceLastRecoveredChange
in interface DatabaseHistoryMXBean
public String getLastAppliedChange()
getLastAppliedChange
in interface DatabaseHistoryMXBean
public String getLastRecoveredChange()
getLastRecoveredChange
in interface DatabaseHistoryMXBean
public void started()
started
in interface DatabaseHistoryListener
public void stopped()
stopped
in interface DatabaseHistoryListener
public void recoveryStarted()
recoveryStarted
in interface DatabaseHistoryListener
public void recoveryStopped()
recoveryStopped
in interface DatabaseHistoryListener
public void onChangeFromHistory(HistoryRecord record)
DatabaseHistoryListener
onChangeFromHistory
in interface DatabaseHistoryListener
public void onChangeApplied(HistoryRecord record)
DatabaseHistoryListener
onChangeApplied
in interface DatabaseHistoryListener
Copyright © 2020 JBoss by Red Hat. All rights reserved.