Package org.apache.ignite.internal.cdc

## Class CdcUtilityActiveCdcManager

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter
  - - org.apache.ignite.internal.cdc.CdcUtilityActiveCdcManager

All Implemented Interfaces:
  `CdcManager`, `PartitionsExchangeAware`, `GridCacheSharedManager`

    public class CdcUtilityActiveCdcManager
    extends GridCacheSharedManagerAdapter
    implements CdcManager, PartitionsExchangeAware

CDC manager that delegates consuming CDC events to the `CdcMain` utility.

### Field Summary

### Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`cctx, diagnosticLog, log`

### Constructor Summary

Constructors
`CdcUtilityActiveCdcManager()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `collect​(ByteBuffer dataBuf)` Callback to collect written WAL records.
`boolean` `enabled()` If this manager isn't enabled then Ignite skips notifying the manager with following methods.
`void` `onDoneAfterTopologyUnlock​(GridDhtPartitionsExchangeFuture fut)` Callback from exchange process completion; called after topology is unlocked.
`protected void` `start0()`

### Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter

`context, isStopping, kernalStartInfo, kernalStopInfo, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, onReconnected, printMemoryStats, start, startInfo, stop, stop0, stopInfo, toString`

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

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

### Methods inherited from interface org.apache.ignite.internal.cdc.CdcManager

`afterBinaryMemoryRestore`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.GridCacheSharedManager

`onDisconnected, onKernalStart, onKernalStop, onReconnected, printMemoryStats, start, stop`

### Methods inherited from interface org.apache.ignite.internal.processors.cache.distributed.dht.preloader.PartitionsExchangeAware

`onDoneBeforeTopologyUnlock, onInitAfterTopologyLock, onInitBeforeTopologyLock`

### Constructor Detail

#### CdcUtilityActiveCdcManager

    public CdcUtilityActiveCdcManager()

### Method Detail

#### start0

    protected void start0()

Overrides:
  `start0` in class `GridCacheSharedManagerAdapter`

#### onDoneAfterTopologyUnlock

    public void onDoneAfterTopologyUnlock​(GridDhtPartitionsExchangeFuture fut)

Description copied from interface: `PartitionsExchangeAware`
Callback from exchange process completion; called after topology is unlocked.

Specified by:
  `onDoneAfterTopologyUnlock` in interface `PartitionsExchangeAware`
Parameters:
  `fut` - Partition map exchange future.

#### enabled

    public boolean enabled()

If this manager isn't enabled then Ignite skips notifying the manager with following methods.

Specified by:
  `enabled` in interface `CdcManager`
Returns:
  `true` if manager is enabled, otherwise `false`.

#### collect

    public void collect​(ByteBuffer dataBuf)

Callback to collect written WAL records. The provided buffer is a continuous part of WAL segment file. The buffer might contain full content of a segment or only piece of it. There are guarantees:

- This method is invoked sequentially.
- Provided `dataBuf` is a continuation of the previous one.
- `dataBuf` contains finite number of completed WAL records. No partially written WAL records are present.
- Records can be read from the buffer with `RecordSerializer.readRecord(FileInput, WALPointer)`.
- `dataBuf` must not be changed within this method.

Implementation suggestions:

- Frequence of calling the method depends on frequence of fsyncing WAL segment. See `IgniteSystemProperties.IGNITE_WAL_SEGMENT_SYNC_TIMEOUT`.
- It must handle the content of the `dataBuf` within the calling thread. Content of the buffer will not be changed before this method returns.
- It must not block the calling thread and work quickly.
- Ignite will ignore any `Throwable` throwed from this method.

Specified by:
  `collect` in interface `CdcManager`
Parameters:
  `dataBuf` - Buffer that contains data to collect.