org.apache.ignite.internal.cdc

## Class CdcEventImpl

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

All Implemented Interfaces:
  Serializable, CdcEvent

    public class CdcEventImpl
    extends Object
    implements CdcEvent

Event of single entry change. Instance presents new value of modified entry.

See Also:
  `CdcMain`, `CdcConsumer`, Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`CdcEventImpl(Object key, Object val, boolean primary, int part, CacheEntryVersion ord, int cacheId)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `cacheId()`
`Object` `key()`
`int` `partition()` Ignite split dataset into smaller chunks to distribute them across the cluster.
`boolean` `primary()`
`String` `toString()`
`Object` `value()`
`CacheEntryVersion` `version()`

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

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

### Constructor Detail

#### CdcEventImpl

    public CdcEventImpl(Object key,
                        Object val,
                        boolean primary,
                        int part,
                        CacheEntryVersion ord,
                        int cacheId)

Parameters:
  `key` - Key.
  `val` - Value.
  `primary` - `True` if changes made on primary node.
  `part` - Partition.
  `ord` - Order of the entry change.
  `cacheId` - Cache id.

### Method Detail

#### key

    public Object key()

Specified by:
  `key` in interface `CdcEvent`
Returns:
  Key for the changed entry.

#### value

    public Object value()

Specified by:
  `value` in interface `CdcEvent`
Returns:
  Value for the changed entry or `null` in case of entry removal.

#### primary

    public boolean primary()

Specified by:
  `primary` in interface `CdcEvent`
Returns:
  `True` if event fired on primary node for partition containing this entry.
See Also:
  Configuring partition backups.

#### partition

    public int partition()

Ignite split dataset into smaller chunks to distribute them across the cluster. `CdcConsumer` implementations can use `CdcEvent.partition()` to split changes processing in the same way as it done for the cache.

Specified by:
  `partition` in interface `CdcEvent`
Returns:
  Partition number.
See Also:
  `Affinity.partition(Object)`, `Affinity.partitions()`, Data partitioning, Affinity collocation

#### version

    public CacheEntryVersion version()

Specified by:
  `version` in interface `CdcEvent`
Returns:
  Version of the entry.

#### cacheId

    public int cacheId()

Specified by:
  `cacheId` in interface `CdcEvent`
Returns:
  Cache ID.
See Also:
  `GridCacheUtils.cacheId(String)`, `CacheView.cacheId()`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022