/** internally we often need to get an entry whether it is a tombstone or not */ public Region.Entry getEntry(Object key, boolean allowTombstones) { return getDataView().getEntry(getKeyInfo(key), this, allowTombstones); }
@Override public Object getEntryForIterator(KeyInfo keyInfo, boolean allowTombstones) { InternalDistributedMember primary = region.getBucketPrimary(keyInfo.getBucketId()); if (primary.equals(state.getTarget())) { return getEntry(keyInfo, allowTombstones); } else { return region.getSharedDataView().getEntry(keyInfo, region, allowTombstones); } }
@Override public Region.Entry getEntry(Object key) { validateKey(key); checkReadiness(); checkForNoAccess(); discoverJTA(); return getDataView().getEntry(getKeyInfo(key), this, false); }
@Override public boolean containsTombstone(Object key) { checkReadiness(); checkForNoAccess(); if (!this.getConcurrencyChecksEnabled()) { return false; } else { try { Entry entry = getDataView().getEntry(getKeyInfo(key), this, true); return entry != null && entry.getValue() == Token.TOMBSTONE; } catch (EntryDestroyedException ignore) { return true; } } }
/** * Just like getEntry but also updates the stats that get would have depending on a flag. See bug * 42410. Also skips discovering JTA * * @return the entry if it exists; otherwise null. */ public Entry accessEntry(Object key, boolean updateStats) { validateKey(key); checkReadiness(); checkForNoAccess(); if (updateStats) { return getDataView().accessEntry(getKeyInfo(key), this); } else { return getDataView().getEntry(getKeyInfo(key), this, false); } }
@Override public Object getEntryForIterator(KeyInfo key, LocalRegion currRgn, boolean rememberReads, boolean allowTombstones) { boolean resetTxState = isTransactionInternalSuspendNeeded(currRgn); TXStateProxy txp = null; if (resetTxState) { txp = getTxMgr().pauseTransaction(); } try { if (resetTxState) { return currRgn.getSharedDataView().getEntry(key, currRgn, allowTombstones); } return getRealDeal(key, currRgn).getEntryForIterator(key, currRgn, rememberReads, allowTombstones); } finally { if (resetTxState) { getTxMgr().unpauseTransaction(txp); } } }
@Override protected boolean operateOnRegion(ClusterDistributionManager dm, LocalRegion r, long startTime) throws RemoteOperationException { r.waitOnInitialization(); // bug #43371 - accessing a region before it's initialized EntrySnapshot val; try { final KeyInfo keyInfo = r.getKeyInfo(key); Region.Entry<?, ?> re = r.getDataView().getEntry(keyInfo, r, true); if (re == null) { r.checkEntryNotFound(key); } NonLocalRegionEntry nlre = new NonLocalRegionEntry(re, r); LocalRegion dataReg = r.getDataRegionForRead(keyInfo); val = new EntrySnapshot(nlre, dataReg, r, false); FetchEntryReplyMessage.send(getSender(), getProcessorId(), val, dm, null); } catch (TransactionException tex) { FetchEntryReplyMessage.send(getSender(), getProcessorId(), null, dm, new ReplyException(tex)); } catch (EntryNotFoundException enfe) { FetchEntryReplyMessage.send(getSender(), getProcessorId(), null, dm, new ReplyException( "entry not found", enfe)); } // Unless there was an exception thrown, this message handles sending the // response return false; }