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 Description GridCacheVersionEx()Externalizablesupport.GridCacheVersionEx(int topVer, int nodeOrderDrId, long order, GridCacheVersion drVer)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GridCacheVersionaddConflictVersion(GridCacheVersion ver, GridCacheVersion conflictVer)GridCacheVersionconflictVersion()shortdirectType()Gets message type.bytefieldsCount()Gets fields count.CacheEntryVersionotherClusterVersion()If source of the update is "local" cluster thennullwill be returned.voidreadExternal(ObjectInput in)booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.StringtoString()voidwriteExternal(ObjectOutput out)booleanwriteTo(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
-
-
-
-
Constructor Detail
-
GridCacheVersionEx
public GridCacheVersionEx()
Externalizablesupport.
-
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:
conflictVersionin classGridCacheVersion- Returns:
- Conflict version.
-
otherClusterVersion
public CacheEntryVersion otherClusterVersion()
If source of the update is "local" cluster thennullwill be returned. If updated comes from the other cluster usingIgniteInternalCache.putAllConflict(Map)then entry version for other cluster.- Specified by:
otherClusterVersionin interfaceCacheEntryVersion- Overrides:
otherClusterVersionin classGridCacheVersion- Returns:
- Replication version.
- See Also:
IgniteInternalCache.putAllConflict(Map),IgniteInternalCache.removeAllConflict(Map)
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Overrides:
directTypein classGridCacheVersion- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridCacheVersion- Returns:
- Fields count.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.- Specified by:
writeToin interfaceMessage- Overrides:
writeToin classGridCacheVersion- 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:
readFromin interfaceMessage- Overrides:
readFromin classGridCacheVersion- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classGridCacheVersion- Throws:
IOException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classGridCacheVersion- Throws:
IOException
-
toString
public String toString()
- Overrides:
toStringin classGridCacheVersion
-
addConflictVersion
public static GridCacheVersion addConflictVersion(GridCacheVersion ver, GridCacheVersion conflictVer)
- Returns:
- If
ver != conflictVerthenverwithconflictVeradded to it.
-
-