org.apache.ignite.internal.cdc

## Class CdcConsumerState

- java.lang.Object
- - org.apache.ignite.internal.cdc.CdcConsumerState

    public class CdcConsumerState
    extends Object

Change Data Capture Consumer state. Each time `CdcConsumer.onEvents(Iterator)` returns `true` current offset in WAL segment 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.

See Also:
  `CdcConsumer.onEvents(Iterator)`, `CdcMain`

### Field Summary

Fields
`static String` `STATE_FILE_NAME`

### Constructor Summary

Constructors
Constructor and Description
`CdcConsumerState(Path stateDir)`

### Method Summary

All Methods Instance Methods Concrete Methods
`WALPointer` `load()` Loads CDC state from file.
`void` `save(WALPointer ptr)` Saves state to file.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### STATE_FILE_NAME

    public static final String STATE_FILE_NAME

See Also:
  Constant Field Values

### Constructor Detail

#### CdcConsumerState

    public CdcConsumerState(Path stateDir)

Parameters:
  `stateDir` - State directory.

### Method Detail

#### save

    public void save(WALPointer ptr)
              throws IOException

Saves state to file.

Parameters:
  `ptr` - WAL pointer.
Throws:
  `IOException`

#### load

    public WALPointer load()

Loads CDC state from file.

Returns:
  Saved state.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022