public class IgniteTxEntry extends Object implements GridPeerDeployAware, Message
Object.equals(Object)
method, as transaction entries should use referential
equality.Modifier and Type | Field and Description |
---|---|
static GridCacheVersion |
GET_ENTRY_INVALID_VER_AFTER_GET |
static GridCacheVersion |
GET_ENTRY_INVALID_VER_UPDATED |
static GridCacheVersion |
SER_READ_EMPTY_ENTRY_VER
Dummy version for non-existing entry read in SERIALIZABLE transaction.
|
static GridCacheVersion |
SER_READ_NOT_EMPTY_VER
Dummy version for any existing entry read in SERIALIZABLE transaction.
|
DIRECT_TYPE_SIZE
Constructor and Description |
---|
IgniteTxEntry()
Required by
Externalizable |
IgniteTxEntry(GridCacheContext<?,?> ctx,
IgniteInternalTx tx,
GridCacheOperation op,
CacheObject val,
javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
Object[] invokeArgs,
long ttl,
GridCacheEntryEx entry,
CacheEntryPredicate[] filters,
GridCacheVersion conflictVer,
boolean skipStore,
boolean keepBinary)
This constructor is meant for local transactions.
|
IgniteTxEntry(GridCacheContext<?,?> ctx,
IgniteInternalTx tx,
GridCacheOperation op,
CacheObject val,
long ttl,
long conflictExpireTime,
GridCacheEntryEx entry,
GridCacheVersion conflictVer,
boolean skipStore,
boolean keepBinary)
This constructor is meant for remote transactions.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntryProcessor(javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor,
Object[] invokeArgs) |
CacheObject |
applyEntryProcessors(CacheObject cacheVal) |
GridCacheEntryEx |
cached() |
void |
cached(GridCacheEntryEx entry) |
int |
cacheId() |
ClassLoader |
classLoader()
Gets class loader for the class.
|
IgniteTxEntry |
cleanCopy(GridCacheContext<?,?> ctx) |
void |
clearEntryReadVersion()
Clears recorded read version, should be done before starting commit of not serializable/optimistic transaction.
|
long |
conflictExpireTime() |
void |
conflictExpireTime(long conflictExpireTime) |
GridCacheVersion |
conflictVersion() |
void |
conflictVersion(GridCacheVersion conflictVer) |
GridCacheContext<?,?> |
context() |
Class<?> |
deployClass()
Gets top level user class being deployed.
|
GridCacheVersion |
dhtVersion() |
void |
dhtVersion(GridCacheVersion dhtVer) |
short |
directType()
Gets message type.
|
T2<GridCacheOperation,CacheObject> |
entryProcessorCalculatedValue() |
void |
entryProcessorCalculatedValue(T2<GridCacheOperation,CacheObject> entryProcessorCalcVal) |
Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> |
entryProcessors() |
void |
entryProcessors(Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> entryProcessorsCol) |
GridCacheVersion |
entryReadVersion()
Gets stored entry version.
|
void |
entryReadVersion(GridCacheVersion ver) |
javax.cache.expiry.ExpiryPolicy |
expiry() |
void |
expiry(javax.cache.expiry.ExpiryPolicy expiryPlc) |
GridCacheVersion |
explicitVersion() |
void |
explicitVersion(GridCacheVersion explicitVer) |
byte |
fieldsCount()
Gets fields count.
|
CacheEntryPredicate[] |
filters() |
void |
filters(CacheEntryPredicate[] filters) |
boolean |
filtersPassed() |
void |
filtersPassed(boolean filtersPassed) |
boolean |
filtersSet() |
void |
filtersSet(boolean filtersSet) |
boolean |
hasOldValue() |
boolean |
hasReadValue() |
boolean |
hasValue() |
boolean |
hasWriteValue() |
boolean |
isRead() |
boolean |
keepBinary() |
void |
keepBinary(boolean keepBinary)
Sets keep binary flag value.
|
KeyCacheObject |
key() |
boolean |
locallyMapped() |
void |
locallyMapped(boolean locMapped) |
boolean |
locked() |
void |
markLocked()
Marks tx entry as locked.
|
void |
markValid()
Marks this entry as value-has-bean-read.
|
void |
marshal(GridCacheSharedContext<?,?> ctx,
boolean transferExpiry) |
UUID |
nodeId() |
void |
nodeId(UUID nodeId) |
CacheObject |
oldValue() |
void |
oldValue(CacheObject oldVal) |
void |
oldValueOnPrimary(boolean oldValOnPrimary) |
void |
onAckReceived()
Method called when ack message received.
|
GridCacheOperation |
op() |
void |
op(GridCacheOperation op) |
GridCacheOperation |
previousOperation() |
CacheObject |
previousValue() |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
void |
readValue(CacheObject val)
Sets read value if this tx entry does not have write value yet.
|
void |
setAndMarkValid(CacheObject val) |
boolean |
skipStore() |
void |
skipStore(boolean skipStore)
Sets skip store flag value.
|
String |
toString() |
long |
ttl() |
void |
ttl(long ttl) |
IgniteTxKey |
txKey() |
void |
unmarshal(GridCacheSharedContext<?,?> ctx,
boolean near,
ClassLoader clsLdr)
Unmarshalls entry.
|
long |
updateCounter() |
void |
updateCounter(long partCntr)
Sets partition counter.
|
CacheObject |
value() |
void |
value(CacheObject val,
boolean writeVal,
boolean readVal) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
public static final GridCacheVersion SER_READ_EMPTY_ENTRY_VER
public static final GridCacheVersion SER_READ_NOT_EMPTY_VER
public static final GridCacheVersion GET_ENTRY_INVALID_VER_UPDATED
public static final GridCacheVersion GET_ENTRY_INVALID_VER_AFTER_GET
public IgniteTxEntry()
Externalizable
public IgniteTxEntry(GridCacheContext<?,?> ctx, IgniteInternalTx tx, GridCacheOperation op, CacheObject val, long ttl, long conflictExpireTime, GridCacheEntryEx entry, @Nullable GridCacheVersion conflictVer, boolean skipStore, boolean keepBinary)
ctx
- Cache registry.tx
- Owning transaction.op
- Operation.val
- Value.ttl
- Time to live.conflictExpireTime
- DR expire time.entry
- Cache entry.conflictVer
- Data center replication version.skipStore
- Skip store flag.public IgniteTxEntry(GridCacheContext<?,?> ctx, IgniteInternalTx tx, GridCacheOperation op, CacheObject val, javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, Object[] invokeArgs, long ttl, GridCacheEntryEx entry, CacheEntryPredicate[] filters, GridCacheVersion conflictVer, boolean skipStore, boolean keepBinary)
ctx
- Cache registry.tx
- Owning transaction.op
- Operation.val
- Value.entryProcessor
- Entry processor.invokeArgs
- Optional arguments for EntryProcessor.ttl
- Time to live.entry
- Cache entry.filters
- Put filters.conflictVer
- Data center replication version.skipStore
- Skip store flag.public GridCacheContext<?,?> context()
public boolean locallyMapped()
public void locallyMapped(boolean locMapped)
locMapped
- Flag indicating if this entry is affinity mapped to the same node.public IgniteTxEntry cleanCopy(GridCacheContext<?,?> ctx)
ctx
- Context.public UUID nodeId()
public void nodeId(UUID nodeId)
nodeId
- Node ID.public GridCacheVersion dhtVersion()
public void dhtVersion(GridCacheVersion dhtVer)
dhtVer
- DHT version.public boolean locked()
True
if tx entry was marked as locked.public void markLocked()
public void updateCounter(long partCntr)
partCntr
- Partition counter.public long updateCounter()
public void setAndMarkValid(CacheObject val)
val
- Value to set.public void markValid()
public KeyCacheObject key()
public int cacheId()
public void skipStore(boolean skipStore)
skipStore
- Skip store flag.public boolean skipStore()
public void oldValueOnPrimary(boolean oldValOnPrimary)
oldValOnPrimary
- True
If old value for was non null on primary node.public void keepBinary(boolean keepBinary)
keepBinary
- Keep binary flag value.public boolean keepBinary()
public IgniteTxKey txKey()
public GridCacheEntryEx cached()
public void cached(GridCacheEntryEx entry)
entry
- Cache entry.@Nullable public CacheObject value()
@Nullable public CacheObject oldValue()
public void oldValue(CacheObject oldVal)
oldVal
- Old value.public boolean hasOldValue()
True
if old value present.public boolean hasValue()
True
if has value explicitly set.public boolean hasWriteValue()
True
if has write value set.public boolean hasReadValue()
True
if has read value set.@Nullable public CacheObject previousValue()
@Nullable public GridCacheOperation previousOperation()
public long ttl()
public void ttl(long ttl)
ttl
- Time to live.public long conflictExpireTime()
public void conflictExpireTime(long conflictExpireTime)
conflictExpireTime
- Conflict expire time.public void value(@Nullable CacheObject val, boolean writeVal, boolean readVal)
val
- Entry value.writeVal
- Write value flag.readVal
- Read value flag.public void readValue(@Nullable CacheObject val)
val
- Read value to set.public void addEntryProcessor(javax.cache.processor.EntryProcessor<Object,Object,Object> entryProcessor, Object[] invokeArgs)
entryProcessor
- Entry processor.invokeArgs
- Optional arguments for EntryProcessor.public Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> entryProcessors()
public CacheObject applyEntryProcessors(CacheObject cacheVal)
cacheVal
- Value.public void entryProcessors(@Nullable Collection<T2<javax.cache.processor.EntryProcessor<Object,Object,Object>,Object[]>> entryProcessorsCol)
entryProcessorsCol
- Collection of entry processors.public GridCacheOperation op()
public void op(GridCacheOperation op)
op
- Cache operation.public boolean isRead()
True
if read entry.public void explicitVersion(GridCacheVersion explicitVer)
explicitVer
- Explicit version.public GridCacheVersion explicitVersion()
@Nullable public GridCacheVersion conflictVersion()
public void conflictVersion(@Nullable GridCacheVersion conflictVer)
conflictVer
- Conflict version.public CacheEntryPredicate[] filters()
public void filters(CacheEntryPredicate[] filters)
filters
- Put filters.public boolean filtersPassed()
True
if filters passed for fast-commit transactions.public void filtersPassed(boolean filtersPassed)
filtersPassed
- True
if filters passed for fast-commit transactions.public boolean filtersSet()
True
if filters are set.public void filtersSet(boolean filtersSet)
filtersSet
- True
if filters are set and should not be replaced.public void marshal(GridCacheSharedContext<?,?> ctx, boolean transferExpiry) throws IgniteCheckedException
ctx
- Context.transferExpiry
- True
if expire policy should be marshalled.IgniteCheckedException
- If failed.public void unmarshal(GridCacheSharedContext<?,?> ctx, boolean near, ClassLoader clsLdr) throws IgniteCheckedException
ctx
- Cache context.near
- Near flag.clsLdr
- Class loader.IgniteCheckedException
- If un-marshalling failed.public void expiry(@Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)
expiryPlc
- Expiry policy.@Nullable public javax.cache.expiry.ExpiryPolicy expiry()
public T2<GridCacheOperation,CacheObject> entryProcessorCalculatedValue()
public void entryProcessorCalculatedValue(T2<GridCacheOperation,CacheObject> entryProcessorCalcVal)
entryProcessorCalcVal
- Entry processor calculated value.@Nullable public GridCacheVersion entryReadVersion()
IgniteCache.getEntry(Object)
method.public void entryReadVersion(GridCacheVersion ver)
ver
- Entry version.public void clearEntryReadVersion()
public void onAckReceived()
onAckReceived
in interface Message
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
public boolean readFrom(ByteBuffer buf, MessageReader reader)
public short directType()
directType
in interface Message
public byte fieldsCount()
fieldsCount
in interface Message
public Class<?> deployClass()
deployClass
in interface GridPeerDeployAware
public ClassLoader classLoader()
GridPeerDeployAware.deployClass()
as well as all of its
dependencies.
Note that in most cases the class loader returned from this method
and the class loader for the class returned from GridPeerDeployAware.deployClass()
method
will be the same. If they are not the same, it is required that the class loader
returned from this method still has to be able to load the deploy class and all its
dependencies.
classLoader
in interface GridPeerDeployAware
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017