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 |
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.
|
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 |
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 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()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023