public class CdcConsumerState extends Object
CdcConsumer.onEvents(Iterator) returns true
current offset in WAL segment and DataEntry index inside DataRecord saved to file.
This allows to the CdcConsumer to continue consumption of the CdcEvent
from the last saved offset in case of fail or restart.CdcConsumer.onEvents(Iterator),
CdcMain| Modifier and Type | Field and Description |
|---|---|
static String |
CACHES_STATE_FILE_NAME |
static String |
CDC_MODE_FILE_NAME
The file stores state of CDC mode.
|
static String |
MAPPINGS_STATE_FILE_NAME |
static String |
TYPES_STATE_FILE_NAME |
static String |
WAL_STATE_FILE_NAME |
| Constructor and Description |
|---|
CdcConsumerState(IgniteLogger log,
Path stateDir) |
| Modifier and Type | Method and Description |
|---|---|
Map<Integer,Long> |
loadCaches()
Loads CDC caches state from file.
|
CdcMode |
loadCdcMode()
Loads CDC mode state from file.
|
Set<T2<Integer,Byte>> |
loadMappingsState()
Loads types mappings state from file.
|
Map<Integer,Long> |
loadTypesState()
Loads CDC types state from file.
|
T2<WALPointer,Integer> |
loadWalState()
Loads CDC consumer state from file.
|
void |
saveCaches(Map<Integer,Long> cachesState)
Saves caches state to file.
|
void |
saveCdcMode(CdcMode mode)
Saves CDC mode state to file.
|
void |
saveMappings(Set<T2<Integer,Byte>> mappingsState)
Saves types mappings state to file.
|
void |
saveTypes(Map<Integer,Long> typesState)
Saves binary types state to file.
|
void |
saveWal(T2<WALPointer,Integer> state)
Saves WAL consumption state to file.
|
public static final String WAL_STATE_FILE_NAME
public static final String TYPES_STATE_FILE_NAME
public static final String MAPPINGS_STATE_FILE_NAME
public static final String CACHES_STATE_FILE_NAME
public static final String CDC_MODE_FILE_NAME
CdcMode value:
CdcMode.CDC_UTILITY_ACTIVE means that CdcMain utility captures data.CdcMode.IGNITE_NODE_ACTIVE means that CdcManager captures data within Ignite node.public CdcConsumerState(IgniteLogger log, Path stateDir)
stateDir - State directory.public void saveWal(T2<WALPointer,Integer> state) throws IOException
state - WAL pointer and index of DataEntry inside DataRecord.IOExceptionpublic void saveTypes(Map<Integer,Long> typesState) throws IOException
typesState - State of types.IOExceptionpublic void saveMappings(Set<T2<Integer,Byte>> mappingsState) throws IOException
mappingsState - Mappings state.IOExceptionpublic T2<WALPointer,Integer> loadWalState()
public Map<Integer,Long> loadCaches()
public void saveCaches(Map<Integer,Long> cachesState) throws IOException
cachesState - State of caches.IOExceptionpublic Set<T2<Integer,Byte>> loadMappingsState()
public Map<Integer,Long> loadTypesState()
public CdcMode loadCdcMode()
public void saveCdcMode(CdcMode mode) throws IOException
mode - CDC mode.IOException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023