Package io.debezium.pipeline.meters
Class SnapshotMeter
- java.lang.Object
-
- io.debezium.pipeline.meters.SnapshotMeter
-
- All Implemented Interfaces:
SchemaMetricsMXBean
,SnapshotMetricsMXBean
@ThreadSafe public class SnapshotMeter extends Object implements SnapshotMetricsMXBean
Carries snapshot metrics.
-
-
Field Summary
Fields Modifier and Type Field Description private Set<String>
capturedTables
private AtomicReference<Object[]>
chunkFrom
private AtomicReference<String>
chunkId
private AtomicReference<Object[]>
chunkTo
private Clock
clock
private ConcurrentMap<String,String>
remainingTables
private ConcurrentMap<String,Long>
rowsScanned
private AtomicBoolean
snapshotAborted
private AtomicBoolean
snapshotCompleted
private AtomicBoolean
snapshotRunning
private AtomicLong
startTime
private AtomicLong
stopTime
private AtomicReference<Object[]>
tableFrom
private AtomicReference<Object[]>
tableTo
-
Constructor Summary
Constructors Constructor Description SnapshotMeter(Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
arrayToString(Object[] array)
void
currentChunk(String chunkId, Object[] chunkFrom, Object[] chunkTo)
void
currentChunk(String chunkId, Object[] chunkFrom, Object[] chunkTo, Object[] tableTo)
void
dataCollectionSnapshotCompleted(DataCollectionId dataCollectionId, long numRows)
String[]
getCapturedTables()
String
getChunkFrom()
String
getChunkId()
String
getChunkTo()
int
getRemainingTableCount()
ConcurrentMap<String,Long>
getRowsScanned()
boolean
getSnapshotAborted()
boolean
getSnapshotCompleted()
long
getSnapshotDurationInSeconds()
boolean
getSnapshotRunning()
String
getTableFrom()
String
getTableTo()
int
getTotalTableCount()
void
monitoredDataCollectionsDetermined(Iterable<? extends DataCollectionId> dataCollectionIds)
void
reset()
void
rowsScanned(TableId tableId, long numRows)
void
snapshotAborted()
void
snapshotCompleted()
void
snapshotStarted()
-
-
-
Field Detail
-
snapshotRunning
private final AtomicBoolean snapshotRunning
-
snapshotCompleted
private final AtomicBoolean snapshotCompleted
-
snapshotAborted
private final AtomicBoolean snapshotAborted
-
startTime
private final AtomicLong startTime
-
stopTime
private final AtomicLong stopTime
-
rowsScanned
private final ConcurrentMap<String,Long> rowsScanned
-
remainingTables
private final ConcurrentMap<String,String> remainingTables
-
chunkId
private final AtomicReference<String> chunkId
-
chunkFrom
private final AtomicReference<Object[]> chunkFrom
-
chunkTo
private final AtomicReference<Object[]> chunkTo
-
tableFrom
private final AtomicReference<Object[]> tableFrom
-
tableTo
private final AtomicReference<Object[]> tableTo
-
clock
private final Clock clock
-
-
Constructor Detail
-
SnapshotMeter
public SnapshotMeter(Clock clock)
-
-
Method Detail
-
getTotalTableCount
public int getTotalTableCount()
- Specified by:
getTotalTableCount
in interfaceSnapshotMetricsMXBean
-
getRemainingTableCount
public int getRemainingTableCount()
- Specified by:
getRemainingTableCount
in interfaceSnapshotMetricsMXBean
-
getSnapshotRunning
public boolean getSnapshotRunning()
- Specified by:
getSnapshotRunning
in interfaceSnapshotMetricsMXBean
-
getSnapshotCompleted
public boolean getSnapshotCompleted()
- Specified by:
getSnapshotCompleted
in interfaceSnapshotMetricsMXBean
-
getSnapshotAborted
public boolean getSnapshotAborted()
- Specified by:
getSnapshotAborted
in interfaceSnapshotMetricsMXBean
-
getSnapshotDurationInSeconds
public long getSnapshotDurationInSeconds()
- Specified by:
getSnapshotDurationInSeconds
in interfaceSnapshotMetricsMXBean
-
getCapturedTables
public String[] getCapturedTables()
- Specified by:
getCapturedTables
in interfaceSchemaMetricsMXBean
-
monitoredDataCollectionsDetermined
public void monitoredDataCollectionsDetermined(Iterable<? extends DataCollectionId> dataCollectionIds)
-
dataCollectionSnapshotCompleted
public void dataCollectionSnapshotCompleted(DataCollectionId dataCollectionId, long numRows)
-
snapshotStarted
public void snapshotStarted()
-
snapshotCompleted
public void snapshotCompleted()
-
snapshotAborted
public void snapshotAborted()
-
rowsScanned
public void rowsScanned(TableId tableId, long numRows)
-
getRowsScanned
public ConcurrentMap<String,Long> getRowsScanned()
- Specified by:
getRowsScanned
in interfaceSnapshotMetricsMXBean
-
currentChunk
public void currentChunk(String chunkId, Object[] chunkFrom, Object[] chunkTo, Object[] tableTo)
-
getChunkId
public String getChunkId()
- Specified by:
getChunkId
in interfaceSnapshotMetricsMXBean
-
getChunkFrom
public String getChunkFrom()
- Specified by:
getChunkFrom
in interfaceSnapshotMetricsMXBean
-
getChunkTo
public String getChunkTo()
- Specified by:
getChunkTo
in interfaceSnapshotMetricsMXBean
-
getTableFrom
public String getTableFrom()
- Specified by:
getTableFrom
in interfaceSnapshotMetricsMXBean
-
getTableTo
public String getTableTo()
- Specified by:
getTableTo
in interfaceSnapshotMetricsMXBean
-
reset
public void reset()
-
-