Class GridCacheRawVersionedEntry<K,V>
- java.lang.Object
-
- org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry
-
- org.apache.ignite.internal.processors.cache.version.GridCacheRawVersionedEntry<K,V>
-
- All Implemented Interfaces:
Externalizable,Serializable,Map.Entry<KeyCacheObject,CacheObject>,GridCacheVersionable,GridCacheVersionedEntry<K,V>,Message
public class GridCacheRawVersionedEntry<K,V> extends DataStreamerEntry implements GridCacheVersionedEntry<K,V>, GridCacheVersionable, Externalizable
Raw versioned entry.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry
key, val
-
Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message
DIRECT_TYPE_SIZE
-
-
Constructor Summary
Constructors Constructor Description GridCacheRawVersionedEntry()Externalizablesupport.GridCacheRawVersionedEntry(byte[] keyBytes, byte[] valBytes, long ttl, long expireTime, GridCacheVersion ver)Constructor used in receiver hub where marshalled key and value are available and we do not want to unmarshal value.GridCacheRawVersionedEntry(KeyCacheObject key, @Nullable CacheObject val, long ttl, long expireTime, GridCacheVersion ver)Constructor used for local store load when key and value are available.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytedataCenterId()Gets ID of initiator data center.shortdirectType()Gets message type.longexpireTime()Gets entry's expire time.bytefieldsCount()Gets fields count.Kkey()Gets entry's key.voidkey(KeyCacheObject key)byte[]keyBytes()voidmarshal(CacheObjectContext ctx, Marshaller marsh)Perform internal marshal of this entry before it will be serialized.longorder()Gets entry's order in initiator data center.voidprepareDirectMarshal(CacheObjectContext ctx)voidreadExternal(ObjectInput in)booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.inttopologyVersion()Gets entry's topology version in initiator data center.StringtoString()longttl()Gets entry's TTL.voidunmarshal(CacheObjectContext ctx)voidunmarshal(CacheObjectContext ctx, Marshaller marsh)Perform internal unmarshal of this entry.voidunmarshalKey(CacheObjectContext ctx, Marshaller marsh)Perform internal key unmarshal of this entry.Vvalue(CacheObjectValueContext ctx)Gets entry's value.byte[]valueBytes()GridCacheVersionversion()voidwriteExternal(ObjectOutput out)booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.-
Methods inherited from class org.apache.ignite.internal.processors.datastreamer.DataStreamerEntry
getKey, getValue, onAckReceived, setValue, toEntry
-
-
-
-
Constructor Detail
-
GridCacheRawVersionedEntry
public GridCacheRawVersionedEntry()
Externalizablesupport.
-
GridCacheRawVersionedEntry
public GridCacheRawVersionedEntry(KeyCacheObject key, @Nullable @Nullable CacheObject val, long ttl, long expireTime, GridCacheVersion ver)
Constructor used for local store load when key and value are available.- Parameters:
key- Key.val- Value.expireTime- Expire time.ttl- TTL.ver- Version.
-
GridCacheRawVersionedEntry
public GridCacheRawVersionedEntry(byte[] keyBytes, byte[] valBytes, long ttl, long expireTime, GridCacheVersion ver)Constructor used in receiver hub where marshalled key and value are available and we do not want to unmarshal value.- Parameters:
keyBytes- Key.valBytes- Value bytes.expireTime- Expire time.ttl- TTL.ver- Version.
-
-
Method Detail
-
key
public K key()
Gets entry's key.- Specified by:
keyin interfaceGridCacheVersionedEntry<K,V>- Returns:
- Entry's key.
-
key
public void key(KeyCacheObject key)
- Parameters:
key- Key.
-
keyBytes
public byte[] keyBytes()
- Returns:
- Key bytes.
-
value
public V value(CacheObjectValueContext ctx)
Gets entry's value.- Specified by:
valuein interfaceGridCacheVersionedEntry<K,V>- Parameters:
ctx- Object value context.- Returns:
- Entry's value.
-
valueBytes
public byte[] valueBytes()
- Returns:
- Value bytes.
-
ttl
public long ttl()
Gets entry's TTL.- Specified by:
ttlin interfaceGridCacheVersionedEntry<K,V>- Returns:
- Entry's TTL.
-
expireTime
public long expireTime()
Gets entry's expire time.- Specified by:
expireTimein interfaceGridCacheVersionedEntry<K,V>- Returns:
- Entry's expire time.
-
dataCenterId
public byte dataCenterId()
Gets ID of initiator data center.- Specified by:
dataCenterIdin interfaceGridCacheVersionedEntry<K,V>- Returns:
- ID of initiator data center.
-
topologyVersion
public int topologyVersion()
Gets entry's topology version in initiator data center.- Specified by:
topologyVersionin interfaceGridCacheVersionedEntry<K,V>- Returns:
- Entry's topology version in initiator data center.
-
order
public long order()
Gets entry's order in initiator data center.- Specified by:
orderin interfaceGridCacheVersionedEntry<K,V>- Returns:
- Entry's order in initiator data center
-
version
public GridCacheVersion version()
- Specified by:
versionin interfaceGridCacheVersionable- Returns:
- Version.
-
unmarshal
public void unmarshal(CacheObjectContext ctx, Marshaller marsh) throws IgniteCheckedException
Perform internal unmarshal of this entry. It must be performed after entry is deserialized and before its restored key/value are needed.- Parameters:
ctx- Context.marsh- Marshaller.- Throws:
IgniteCheckedException- If failed.
-
unmarshal
public void unmarshal(CacheObjectContext ctx) throws IgniteCheckedException
- Parameters:
ctx- Context.- Throws:
IgniteCheckedException- If failed.
-
unmarshalKey
public void unmarshalKey(CacheObjectContext ctx, Marshaller marsh) throws IgniteCheckedException
Perform internal key unmarshal of this entry. It must be performed after entry is deserialized and before its restored key/value are needed.- Parameters:
ctx- Context.marsh- Marshaller.- Throws:
IgniteCheckedException- If failed.
-
marshal
public void marshal(CacheObjectContext ctx, Marshaller marsh) throws IgniteCheckedException
Perform internal marshal of this entry before it will be serialized.- Parameters:
ctx- Context.marsh- Marshaller.- Throws:
IgniteCheckedException- If failed.
-
prepareDirectMarshal
public void prepareDirectMarshal(CacheObjectContext ctx) throws IgniteCheckedException
- Parameters:
ctx- Context.- Throws:
IgniteCheckedException- If failed.
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Overrides:
directTypein classDataStreamerEntry- Returns:
- Message type.
-
readFrom
public boolean readFrom(ByteBuffer buf, MessageReader reader)
Reads this message from provided byte buffer.- Specified by:
readFromin interfaceMessage- Overrides:
readFromin classDataStreamerEntry- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.- Specified by:
writeToin interfaceMessage- Overrides:
writeToin classDataStreamerEntry- Parameters:
buf- Byte buffer.writer- Writer.- Returns:
- Whether message was fully written.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classDataStreamerEntry- Returns:
- Fields count.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
toString
public String toString()
- Overrides:
toStringin classDataStreamerEntry
-
-