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)
public boolean containsValueForKey(KeyInfo keyInfo, LocalRegion region) { TXEntryState tx = txReadEntry(keyInfo, region, true, true/*create txEntry is absent*/); if (tx != null) { /** * Note that we don't consult this.getDataPolicy().isProxy() when * setting this because in this context we don't want proxies to pretend * they have a value. */ boolean isProxy = false; return tx.isLocallyValid(isProxy); } else { return region.nonTXContainsValueForKey(keyInfo); } }
/** * @param keyInfo * @param localRegion * @param rememberRead true if the value read from committed state * needs to be remembered in tx state for repeatable read. * @param createIfAbsent should a transactional entry be created if not present. * Used by sql fabric system * @return a txEntryState or null if the entry doesn't exist in the transaction and/or committed state. */ public TXEntryState txReadEntry(KeyInfo keyInfo, LocalRegion localRegion, boolean rememberRead, boolean createIfAbsent) { // EntryNotFoundException can be expected in case of sqlfabric and should // not be caught. localRegion.cache.getCancelCriterion().checkCancelInProgress(null); return txReadEntry(keyInfo, localRegion, rememberRead, null, createIfAbsent); }
public Object getDeserializedValue(KeyInfo keyInfo, LocalRegion localRegion, boolean updateStats, boolean disableCopyOnRead, boolean preferCD, EntryEventImpl clientEvent, boolean returnTombstones, boolean allowReadFromHDFS, boolean retainResult) { TXEntryState tx = txReadEntry(keyInfo, localRegion, true, true/*create txEntry is absent*/); if (tx != null) { Object v = tx.getValue(keyInfo, localRegion, preferCD); if(!disableCopyOnRead) { v = localRegion.conditionalCopy(v); } return v; } else { return localRegion.getDeserializedValue(null, keyInfo, updateStats, disableCopyOnRead, preferCD, clientEvent, returnTombstones, allowReadFromHDFS, retainResult); } }
@Retained public Object getValueInVM(KeyInfo keyInfo, LocalRegion localRegion, boolean rememberRead) { TXEntryState tx = txReadEntry(keyInfo, localRegion, rememberRead,true/*create txEntry is absent*/); if (tx != null) { return tx.getValueInVM(keyInfo); } return localRegion.nonTXbasicGetValueInVM(keyInfo); }
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; } }
@Retained public Object getSerializedValue(LocalRegion localRegion, KeyInfo keyInfo, boolean doNotLockEntry, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones, boolean allowReadFromHDFS) throws DataLocationException { final Object key = keyInfo.getKey(); TXEntryState tx = txReadEntry(keyInfo, localRegion, true,true/*create txEntry is absent*/); if (tx != null) { Object val = tx.getPendingValue(); if(val==null || Token.isInvalidOrRemoved(val)) { val = findObject(keyInfo,localRegion, val!=Token.INVALID, true, val, false, false, requestingClient, clientEvent, false, allowReadFromHDFS); } return val; } else { // rememberRead is always true for now, // so we should never come here assert localRegion instanceof PartitionedRegion; PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.getDataStore().getSerializedLocally(keyInfo, doNotLockEntry, null, returnTombstones, allowReadFromHDFS); } }
final LocalRegion region = event.getRegion(); final Operation op = event.getOperation(); TXEntryState tx = txReadEntry(event.getKeyInfo(), region, true, expectedOldValue, true/*create txEntry is absent*/); assert tx != null;
TXEntryState tx = txReadEntry(event.getKeyInfo(), region, true, expectedOldValue, createIfAbsent); if (tx != null) {
boolean locked = true; try { final TXEntryState txEntry = txState.txReadEntry(event, this.region, dataRegion, txr, Operation.GET); if (txEntry != null) {