public class WalRecordsConsumer<K,V> extends Object
CdcMain,
CdcConsumer| Modifier and Type | Class and Description |
|---|---|
static class |
WalRecordsConsumer.DataEntryIterator
Iterator over
DataEntry. |
| Modifier and Type | Field and Description |
|---|---|
static String |
EVTS_CNT
Events count metric name.
|
static String |
LAST_EVT_TIME
Last event time metric name.
|
| Constructor and Description |
|---|
WalRecordsConsumer(CdcConsumer consumer,
IgniteLogger log) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alive()
Checks that consumer still alive.
|
CdcConsumer |
consumer() |
void |
onCacheDestroyEvents(Iterator<Integer> caches)
Handles destroy cache events.
|
void |
onCacheEvents(Iterator<CdcCacheEvent> cacheEvts)
Handles new cache events.
|
void |
onMappings(Iterator<TypeMapping> mappings)
Handles new mappings.
|
boolean |
onRecords(Iterator<DataEntry> entries)
Handles data entries.
|
void |
onTypes(Iterator<BinaryType> types)
Handles new binary types.
|
void |
start(MetricRegistry cdcReg,
MetricRegistry cdcConsumerReg)
Starts the consumer.
|
void |
stop()
Stops the consumer.
|
String |
toString() |
public static final String EVTS_CNT
public static final String LAST_EVT_TIME
public WalRecordsConsumer(CdcConsumer consumer, IgniteLogger log)
consumer - User provided CDC consumer.log - Logger.public boolean onRecords(Iterator<DataEntry> entries)
true then current offset in WAL and DataEntry index inside
DataRecord will be stored and WAL iteration will be started from it on CDC application fail/restart.entries - Data entries iterator.True if current offset in WAL should be commited.public void onTypes(Iterator<BinaryType> types)
types - Binary types iterator.public void onMappings(Iterator<TypeMapping> mappings)
mappings - Mappings iterator.public void onCacheEvents(Iterator<CdcCacheEvent> cacheEvts)
cacheEvts - Cache events iterator.public void onCacheDestroyEvents(Iterator<Integer> caches)
caches - Destroyed cache iterator.public void start(MetricRegistry cdcReg, MetricRegistry cdcConsumerReg) throws IgniteCheckedException
cdcReg - CDC metric registry.cdcConsumerReg - CDC consumer metric registry.IgniteCheckedException - If failed.public void stop()
start(MetricRegistry, MetricRegistry).public boolean alive()
CdcConsumer errors in case CdcEvent is rare or source cluster is down.True in case consumer alive, false otherwise.public CdcConsumer consumer()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023