public class GridCacheTxEntry<K,V> extends Object implements GridPeerDeployAware, Externalizable, GridOptimizedMarshallable
Object.equals(Object) method, as transaction entries should use referential
equality.CLS_ID_FIELD_NAME| Constructor and Description |
|---|
GridCacheTxEntry()
Required by
Externalizable |
GridCacheTxEntry(GridCacheContext<K,V> ctx,
GridCacheTxEx<K,V> tx,
GridCacheOperation op,
V val,
GridClosure<V,V> transformClos,
long ttl,
GridCacheEntryEx<K,V> entry,
GridPredicate<GridCacheEntry<K,V>>[] filters,
GridCacheVersion drVer)
This constructor is meant for local transactions.
|
GridCacheTxEntry(GridCacheContext<K,V> ctx,
GridCacheTxEx<K,V> tx,
GridCacheOperation op,
V val,
long ttl,
long drExpireTime,
GridCacheEntryEx<K,V> entry,
GridCacheVersion drVer)
This constructor is meant for remote transactions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTransformClosure(GridClosure<V,V> transformClos) |
GridCacheEntryEx<K,V> |
cached() |
void |
cached(GridCacheEntryEx<K,V> entry,
byte[] keyBytes) |
ClassLoader |
classLoader()
Gets class loader for the class.
|
GridCacheTxEntry<K,V> |
cleanCopy(GridCacheContext<K,V> ctx) |
Class<?> |
deployClass()
Gets top level user class being deployed.
|
GridCacheVersion |
dhtVersion() |
void |
dhtVersion(GridCacheVersion dhtVer) |
long |
drExpireTime() |
void |
drExpireTime(long drExpireTime) |
GridCacheVersion |
drVersion() |
void |
drVersion(GridCacheVersion drVer) |
GridCacheVersion |
explicitVersion() |
void |
explicitVersion(GridCacheVersion explicitVer) |
GridPredicate<GridCacheEntry<K,V>>[] |
filters() |
void |
filters(GridPredicate<GridCacheEntry<K,V>>[] filters) |
boolean |
filtersPassed() |
void |
filtersPassed(boolean filtersPassed) |
boolean |
filtersSet() |
void |
filtersSet(boolean filtersSet) |
Object |
ggClassId()
Implementation of this method should simply return value of
GG_CLASS_ID field. |
boolean |
groupLockEntry() |
void |
groupLockEntry(boolean grpLock) |
boolean |
hasReadValue() |
boolean |
hasValue() |
boolean |
hasWriteValue() |
boolean |
isRead() |
K |
key() |
byte[] |
keyBytes() |
void |
keyBytes(byte[] keyBytes) |
boolean |
locallyMapped() |
void |
locallyMapped(boolean locMapped) |
boolean |
locked() |
void |
markLocked()
Marks tx entry as locked.
|
void |
marshal(GridCacheContext<K,V> ctx) |
UUID |
nodeId() |
void |
nodeId(UUID nodeId) |
GridCacheOperation |
op() |
void |
op(GridCacheOperation op) |
GridCacheOperation |
previousOperation() |
V |
previousValue() |
void |
readExternal(ObjectInput in) |
void |
readValue(V val)
Sets read value if this tx entrty does not have write value yet.
|
String |
toString() |
boolean |
transferRequired() |
void |
transferRequired(boolean transferRequired) |
Collection<GridClosure<V,V>> |
transformClosures() |
void |
transformClosures(Collection<GridClosure<V,V>> transformClosCol) |
long |
ttl() |
void |
ttl(long ttl) |
void |
unmarshal(GridCacheContext<K,V> ctx,
ClassLoader clsLdr)
Unmarshalls entry.
|
V |
value() |
void |
value(V val,
boolean writeVal,
boolean readVal) |
byte[] |
valueBytes() |
void |
valueBytes(byte[] valBytes) |
void |
writeExternal(ObjectOutput out) |
public GridCacheTxEntry()
Externalizablepublic GridCacheTxEntry(GridCacheContext<K,V> ctx, GridCacheTxEx<K,V> tx, GridCacheOperation op, V val, long ttl, long drExpireTime, GridCacheEntryEx<K,V> entry, @Nullable GridCacheVersion drVer)
ctx - Cache registry.tx - Owning transaction.op - Operation.val - Value.ttl - Time to live.drExpireTime - DR expire time.entry - Cache entry.drVer - Data center replication version.public GridCacheTxEntry(GridCacheContext<K,V> ctx, GridCacheTxEx<K,V> tx, GridCacheOperation op, V val, GridClosure<V,V> transformClos, long ttl, GridCacheEntryEx<K,V> entry, GridPredicate<GridCacheEntry<K,V>>[] filters, GridCacheVersion drVer)
ctx - Cache registry.tx - Owning transaction.op - Operation.val - Value.transformClos - Transform closure.ttl - Time to live.entry - Cache entry.filters - Put filters.drVer - Data center replication version.public boolean locallyMapped()
public void locallyMapped(boolean locMapped)
locMapped - Flag indicating if this entry is affinity mapped to the same node.public boolean groupLockEntry()
True if this entry was added in group lock transaction and
this is not a group lock entry.public void groupLockEntry(boolean grpLock)
grpLock - True if this entry was added in group lock transaction and
this is not a group lock entry.public void transferRequired(boolean transferRequired)
transferRequired - Sets flag indicating that transfer is required to remote node.public boolean transferRequired()
public GridCacheTxEntry<K,V> cleanCopy(GridCacheContext<K,V> 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 K key()
@Nullable public byte[] keyBytes()
public void keyBytes(byte[] keyBytes)
keyBytes - Key bytes.public GridCacheEntryEx<K,V> cached()
public void cached(GridCacheEntryEx<K,V> entry, @Nullable byte[] keyBytes)
entry - Cache entry.keyBytes - Key bytes, possibly null.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 GridCacheOperation previousOperation()
@Nullable public byte[] valueBytes()
public void valueBytes(@Nullable byte[] valBytes)
valBytes - Value bytes.public long ttl()
public void ttl(long ttl)
ttl - Time to live.public long drExpireTime()
public void drExpireTime(long drExpireTime)
drExpireTime - DR expire time.public void value(@Nullable V val, boolean writeVal, boolean readVal)
val - Entry value.writeVal - Write value flag.readVal - Read value flag.public void readValue(@Nullable V val)
val - Read value to set.public void addTransformClosure(GridClosure<V,V> transformClos)
transformClos - Transform closure.public Collection<GridClosure<V,V>> transformClosures()
public void transformClosures(@Nullable Collection<GridClosure<V,V>> transformClosCol)
transformClosCol - Collection of transform closures.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 drVersion()
public void drVersion(@Nullable GridCacheVersion drVer)
drVer - DR version.public GridPredicate<GridCacheEntry<K,V>>[] filters()
public void filters(GridPredicate<GridCacheEntry<K,V>>[] 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(GridCacheContext<K,V> ctx) throws GridException
ctx - Context.GridException - If failed.public void unmarshal(GridCacheContext<K,V> ctx, ClassLoader clsLdr) throws GridException
ctx - Cache context.clsLdr - Class loader.GridException - If un-marshalling failed.public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic Object ggClassId()
GG_CLASS_ID field.ggClassId in interface GridOptimizedMarshallablepublic Class<?> deployClass()
deployClass in interface GridPeerDeployAwarepublic 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 GridPeerDeployAwareCopyright © 2014. All rights reserved.