org.apache.ignite.internal.processors.cache.version

## Class GridCacheVersionEx

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.version.GridCacheVersion
  - - org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx

All Implemented Interfaces:
  Externalizable, Serializable, Comparable<CacheEntryVersion>, CacheEntryVersion, Message

    public class GridCacheVersionEx
    extends GridCacheVersion

Extended cache version which also has additional DR version.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheVersionEx()` `Externalizable` support.
`GridCacheVersionEx(int topVer, int nodeOrderDrId, long order, GridCacheVersion drVer)` Constructor.
`GridCacheVersionEx(int topVer, long order, int nodeOrder, byte dataCenterId, GridCacheVersion drVer)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`GridCacheVersion` `conflictVersion()`
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`CacheEntryVersion` `otherClusterVersion()` If source of the update is "local" cluster then `null` will be returned.
`void` `readExternal(ObjectInput in)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

`asIgniteUuid, clusterId, compareTo, dataCenterId, equals, hashCode, isGreater, isGreaterEqual, isLess, isLessEqual, nodeOrder, nodeOrderAndDrIdRaw, onAckReceived, order, topologyVersion`

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

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

### Constructor Detail

#### GridCacheVersionEx

    public GridCacheVersionEx()

`Externalizable` support.

#### GridCacheVersionEx

    public GridCacheVersionEx(int topVer,
                              long order,
                              int nodeOrder,
                              byte dataCenterId,
                              GridCacheVersion drVer)

Constructor.

Parameters:
  `topVer` - Topology version.
  `order` - Order.
  `nodeOrder` - Node order.
  `dataCenterId` - Data center ID.
  `drVer` - DR version.

#### GridCacheVersionEx

    public GridCacheVersionEx(int topVer,
                              int nodeOrderDrId,
                              long order,
                              GridCacheVersion drVer)

Constructor.

Parameters:
  `topVer` - Topology version.
  `nodeOrderDrId` - Node order and DR ID.
  `order` - Version order.
  `drVer` - DR version.

### Method Detail

#### conflictVersion

    public GridCacheVersion conflictVersion()

Overrides:
  `conflictVersion` in class `GridCacheVersion`
Returns:
  Conflict version.

#### otherClusterVersion

    public CacheEntryVersion otherClusterVersion()

If source of the update is "local" cluster then `null` will be returned. If updated comes from the other cluster using `IgniteInternalCache.putAllConflict(Map)` then entry version for other cluster.

Specified by:
  `otherClusterVersion` in interface `CacheEntryVersion`
Overrides:
  `otherClusterVersion` in class `GridCacheVersion`
Returns:
  Replication version.
See Also:
  `IgniteInternalCache.putAllConflict(Map)`, `IgniteInternalCache.removeAllConflict(Map)`

#### directType

    public short directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Overrides:
  `directType` in class `GridCacheVersion`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Overrides:
  `fieldsCount` in class `GridCacheVersion`
Returns:
  Fields count.

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                           MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Overrides:
  `writeTo` in class `GridCacheVersion`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                            MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Overrides:
  `readFrom` in class `GridCacheVersion`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException

Specified by:
  `readExternal` in interface `Externalizable`
Overrides:
  `readExternal` in class `GridCacheVersion`
Throws:
  `IOException`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Overrides:
  `writeExternal` in class `GridCacheVersion`
Throws:
  `IOException`

#### toString

    public String toString()

Overrides:
  `toString` in class `GridCacheVersion`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

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