/** * @since GemFire 5.0 * @throws UnsupportedOperationException OVERRIDES */ @Override public void localInvalidateRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionInvalidate(); throw new UnsupportedOperationException(); }
@Override public boolean containsKey(Object key) { checkReadiness(); validateKey(key); return getDataView().containsKey(getKeyInfo(key), this); }
@Override public void localDestroyRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionDestroy(); String prName = this.getColocatedWith(); List<PartitionedRegion> listOfChildRegions = ColocationHelper.getColocatedChildRegions(this); List<String> childRegionsWithoutSendersList = new ArrayList<String>(); if (listOfChildRegions.size() != 0) { for (PartitionedRegion childRegion : listOfChildRegions) { if (!childRegion.getName().contains(ParallelGatewaySenderQueue.QSTRING)) { childRegionsWithoutSendersList.add(childRegion.getFullPath()); } } } if ((prName != null) || (!childRegionsWithoutSendersList.isEmpty())) { throw new UnsupportedOperationException( "Any Region in colocation chain cannot be destroyed locally."); } RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()/* generate EventID */); try { basicDestroyRegion(event, false); } catch (CacheWriterException e) { // not possible with local operation, CacheWriter not called throw new Error("CacheWriterException should not be thrown in localDestroyRegion", e); } catch (TimeoutException e) { // not possible with local operation, no distributed locks possible throw new Error("TimeoutException should not be thrown in localDestroyRegion", e); } }
@Override void basicUpdateEntryVersion(EntryEventImpl event) throws EntryNotFoundException { try { if (event.getEventId() == null) { event.setNewEventId(this.cache.getDistributedSystem()); } getDataView().updateEntryVersion(event); } catch (RegionDestroyedException rde) { if (!rde.getRegionFullPath().equals(getFullPath())) { // Handle when a bucket is destroyed throw new RegionDestroyedException(toString(), getFullPath(), rde); } } return; }
@Override public void destroyRegion(Object aCallbackArgument) throws CacheWriterException, TimeoutException { this.cache.invokeBeforeDestroyed(this); checkForColocatedChildren(); getDataView().checkSupportsRegionDestroy(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()); basicDestroyRegion(event, true); }
/** * Returns whether there is a valid (non-null) value present for the specified key, locally or * remotely. This method is equivalent to: * * <pre> * Entry e = getEntry(key); * return e != null && e.getValue() != null; * </pre> * * This method does not consult localCache, even if enabled. * * @param key the key to check for a valid value * @return true if there is an entry in this region for the specified key and it has a valid value * OVERRIDES */ @Override public boolean containsValueForKey(Object key) { // checkClosed(); checkReadiness(); validateKey(key); final long startTime = PartitionedRegionStats.startTime(); boolean containsValueForKey = false; try { containsValueForKey = getDataView().containsValueForKey(getKeyInfo(key), this); } finally { this.prStats.endContainsValueForKey(startTime); } return containsValueForKey; }
Integer bucket = Integer.valueOf(PartitionedRegionHelper.getHashKey(event)); pr.getDataView().updateEntryVersion(event);
@Override public void basicDestroy(final EntryEventImpl event, final boolean cacheWrite, final Object expectedOldValue) throws TimeoutException, EntryNotFoundException, CacheWriterException { final long startTime = PartitionedRegionStats.startTime(); try { if (event.getEventId() == null) { event.setNewEventId(this.cache.getDistributedSystem()); } discoverJTA(); getDataView().destroyExistingEntry(event, cacheWrite, expectedOldValue); } catch (RegionDestroyedException rde) { if (!rde.getRegionFullPath().equals(getFullPath())) { // Handle when a bucket is destroyed throw new RegionDestroyedException(toString(), getFullPath(), rde); } } finally { this.prStats.endDestroy(startTime); } }
@Override public void basicInvalidate(EntryEventImpl event) throws EntryNotFoundException { final long startTime = PartitionedRegionStats.startTime(); try { if (event.getEventId() == null) { event.setNewEventId(this.cache.getDistributedSystem()); } discoverJTA(); getDataView().invalidateExistingEntry(event, isInitialized(), false); } catch (RegionDestroyedException rde) { if (!rde.getRegionFullPath().equals(getFullPath())) { // Handle when a bucket is destroyed throw new RegionDestroyedException(toString(), getFullPath(), rde); } } finally { this.prStats.endInvalidate(startTime); } return; }
assert r.getDataView() instanceof TXStateProxy; boolean lockEntry = forceUseOfPRExecutor || isDirectAck(); val = r.getDataView().getSerializedValue(r, keyInfo, !lockEntry, this.context, event, returnTombstones);
/** * override the one in LocalRegion since we don't need to do getDeserialized. */ @Override public Object get(Object key, Object aCallbackArgument, boolean generateCallbacks, boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones) throws TimeoutException, CacheLoaderException { validateKey(key); checkReadiness(); checkForNoAccess(); discoverJTA(); CachePerfStats stats = getCachePerfStats(); long start = stats.startGet(); boolean miss = true; try { // if scope is local and there is no loader, then // don't go further to try and get value Object value = getDataView().findObject(getKeyInfo(key, aCallbackArgument), this, true/* isCreate */, generateCallbacks, null /* no local value */, disableCopyOnRead, preferCD, requestingClient, clientEvent, returnTombstones); if (value != null && !Token.isInvalid(value)) { miss = false; } return value; } finally { stats.endGet(start, miss); } }
r.getDataView().destroyOnRemote(ev, cacheWrite, null); didRemove = true; if (logger.isDebugEnabled()) {
Integer bucket = Integer.valueOf(PartitionedRegionHelper.getHashKey(event)); event.setCausedByMessage(this); r.getDataView().invalidateOnRemote(event, true/* invokeCallbacks */, false/* forceNewEntry */); this.versionTag = event.getVersionTag();
didPut = r.getDataView().putEntryOnRemote(ev, false, false, null, false, lastModified, true); if (didPut && logger.isDebugEnabled()) {
.valueOf(PartitionedRegionHelper.getHashKey(r, null, this.key, null, this.cbArg)); event.setCausedByMessage(this); r.getDataView().destroyOnRemote(event, true/* cacheWrite */, this.expectedOldValue); if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(LogMarker.DM_VERBOSE, "{} updated bucket: {} with key: {}",
ev.setOriginRemote(false); result = r.getDataView().putEntryOnRemote(ev, this.ifNew, this.ifOld, this.expectedOldValue, this.requireOldValue, this.lastModified, true/* overwriteDestroyed *not* used */);
try { KeyInfo keyInfo = r.getKeyInfo(key); val = (EntrySnapshot) r.getDataView().getEntryOnRemote(keyInfo, r, true); r.getPrStats().endPartitionMessagesProcessing(startTime); FetchEntryReplyMessage.send(getSender(), getProcessorId(), val, dm, null);