public boolean isDestroyed() { checkTX(); return !this.txes.existsLocally(); }
private boolean readEntryAndCheckIfDestroyed(KeyInfo keyInfo, LocalRegion localRegion, boolean rememberReads) { TXEntryState tx = txReadEntry(keyInfo, localRegion, rememberReads, true/*create txEntry is absent*/); if (tx != null) { if (!tx.existsLocally()) { // It was destroyed by the transaction so skip // this key and try the next one return true; // fix for bug 34583 } } return false; }
public boolean containsKey(KeyInfo keyInfo, LocalRegion localRegion) { TXEntryState tx = txReadEntry(keyInfo, localRegion, true,true/*create txEntry is absent*/); if (tx != null) { return tx.existsLocally(); } else { return localRegion.nonTXContainsKey(keyInfo); } } /* (non-Javadoc)
@Retained public final Object getValueInVM(Object key) throws EntryNotFoundException { if (!existsLocally()) { throw new EntryNotFoundException(String.valueOf(key)); } return getRetainedValueInTXOrRegion(); }
@Retained public Object getValueInVM(Object key) throws EntryNotFoundException { if (!existsLocally()) { throw new EntryNotFoundException(String.valueOf(key)); } return getNearSidePendingValue(); }
private final int lockState(TXEntryState tx, byte opType, Object callbackArg, boolean markPending) { if (tx.existsLocally()) { if (tx.checkAndClearGIIEntry() && tx.op == opType) { // mark it as pending and return if (markPending) { markPending(tx, opType, callbackArg); } return LOCK_ADDED; } else { return LOCK_ALREADY_HELD_IN_TX; } } else { return LOCK_ALREADY_HELD_IN_TX_NO_VALUE; } }
/** * @param key * @return the value, or null if the value does not exist in the cache, * Token.INVALID or Token.LOCAL_INVALID if the value is invalid */ public Object getValue(Object key, Region r, boolean preferCD) { if (!existsLocally()) { return null; } Object v = getNearSidePendingValue(); if (v instanceof CachedDeserializable && !preferCD) { // The only reason we would is if we do a read // in a transaction and the initial op that created the TXEntryState // did not call getDeserializedValue. // If a write op is done then the pendingValue does not belong to // the cache yet so we do not need the RegionEntry. // If we do need the RegionEntry then TXEntryState // will need to be changed to remember the RegionEntry it is created with. v = ((CachedDeserializable)v).getDeserializedValue(r, this.refCountEntry); } return v; }
public Entry getEntry(final KeyInfo keyInfo, final LocalRegion region, boolean allowTombstones) { TXEntryState tx = txReadEntry(keyInfo, region, true, true/*create txEntry is absent*/); if (tx != null && tx.existsLocally()) { return new TXEntry(region, keyInfo, getProxy()); } else { return null; } }
/** * @return the value, or null if the value does not exist in the cache, * Token.INVALID or Token.LOCAL_INVALID if the value is invalid */ public final Object getValue(Region<?, ?> r) { if (!existsLocally()) { return null; } Object v = getNearSidePendingValue(); if (v != null && v instanceof CachedDeserializable) { // The only reason we would is if we do a read // in a transaction and the initial op that created the TXEntryState // did not call getDeserializedValue. // If a write op is done then the pendingValue does not belong to // the cache yet so we do not need the RegionEntry. // If we do need the RegionEntry then TXEntryState // will need to be changed to remember the RegionEntry it is created with. // [sumedh] now we do remember the RegionEntry since it is obtained at // the initial lock if (r == null) { r = this.txRegionState.region; } v = ((CachedDeserializable)v).getDeserializedValue(r, this.regionEntry); } return v; }
public boolean containsKey(Object key, Object callbackArg, LocalRegion localRegion) { final LocalRegion dataRegion = localRegion.getDataRegionForRead(key, callbackArg, KeyInfo.UNKNOWN_BUCKET, Operation.CONTAINS_KEY); final TXRegionState txr = readRegion(dataRegion); if (txr != null) { txr.lock(); try { final Object txEntry = txr.readEntry(key); if (txEntry != null) { if (txEntry instanceof TXEntryState) { return ((TXEntryState)txEntry).existsLocally(); } else { // for read locked entries, no need to take the read lock again final AbstractRegionEntry re = (AbstractRegionEntry)txEntry; return !re.isDestroyedOrRemoved(); } } } finally { txr.unlock(); } } return localRegion.txContainsKey(key, callbackArg, this, false); }
expectedOldValue, createIfAbsent); if (tx != null) { if (requireOldValue && tx.existsLocally()) { event.setOldValue(tx.getNearSidePendingValue(), true); boolean existsLocally = tx.existsLocally(); if (!existsLocally && event.getOperation() == Operation.REPLACE) { throw new EntryNotFoundException("No previously created Entry to be updated");
final Object txEntry = txr.readEntry(key); if (txEntry instanceof TXEntryState && !((TXEntryState)txEntry).existsLocally()) {
expectedOldValue, true/*create txEntry is absent*/); assert tx != null; if (tx.existsLocally()) { final boolean invalidatingInvalidEntry = op.isInvalidate() && Token.isInvalid(tx.getValueInVM(entryKey));
if (txEntry instanceof TXEntryState) { final TXEntryState txes = (TXEntryState)txEntry; if (txes.existsLocally()) { if (txes.isDirty()) { return new TXEntry(localRegion, dataRegion, key, txes, this);
logger.info(LocalizedStrings.DEBUG, "getLocalEntry: for region " + dataRegion.getFullPath() + " found " + tx + " existsLocally=" + tx.existsLocally() + " for RegionEntry(" + re + ')'); if (tx.existsLocally()) { if (tx.isDirty()) { return tx;
if (txEntry instanceof TXEntryState) { final TXEntryState txes = (TXEntryState)txEntry; if (txes.existsLocally()) { if (txes.isDirty()) { return new TXEntry(region, dataRegion, key, txes, this);
boolean doingCreate = true; if (!ifNew) { if (existsLocally()) { putOp = OP_PUT; doingCreate = false;
if (tx.existsLocally(true)) { event.setTXOldValue(val); final boolean invalidatingInvalidEntry = event.getOperation()
if (tx.existsLocally()) {