@Override protected final GemFireCacheImpl getGemFireCache() { return this.region.getGemFireCache(); }
@Override protected final GemFireCacheImpl getGemFireCache() { return this.region.getGemFireCache(); }
@Override protected final GemFireCacheImpl getGemFireCache() { return this.region.getGemFireCache(); }
@Override protected final GemFireCacheImpl getGemFireCache() { return this.region.getGemFireCache(); }
@Override protected final GemFireCacheImpl getGemFireCache() { return this.region.getGemFireCache(); }
@Override protected final GemFireCacheImpl getGemFireCache() { return this.region.getGemFireCache(); }
EntriesSet(LocalRegion region, boolean recursive, IteratorType viewType, final TXStateInterface tx, final boolean skipTxCheckInIteration, boolean allowTombstones) { this.topRegion = region; this.recursive = recursive; this.iterType = viewType; this.myTX = tx; this.view = region.getDataView(tx); this.skipTxCheckInIteration = skipTxCheckInIteration || region.getGemFireCache().isGFXDSystem(); this.allowTombstones = allowTombstones; }
EntriesSet(LocalRegion region, boolean recursive, IteratorType viewType, final boolean rememberReads, final boolean skipTxCheckInIteration, boolean allowTombstones) { this.topRegion = region; this.recursive = recursive; this.iterType = viewType; this.myTX = region.getTXState(); this.skipTxCheckInIteration = skipTxCheckInIteration || region.getGemFireCache().isSqlfSystem(); this.view = this.myTX == null ? region.getSharedDataView() : this.myTX; this.rememberReads = true; this.allowTombstones = allowTombstones; }
/** * used for instantiation of a profile associated with a region and * not describing region filters in a different process. Do not use * this method when instantiating profiles to store in distribution * advisor profiles. * @param r */ public FilterProfile(LocalRegion r) { this.region = r; this.isLocalProfile = true; this.memberID = region.getMyId(); this.cqCount = new AtomicInteger(); this.clientMap = new IDMap(); this.cqMap = new IDMap(); this.localProfile.hasCacheServer = (r.getGemFireCache().getCacheServers().size() > 0); }
/** * Asif: If the system is sqlfabric and the event has delta, then re == null * implies update on non existent row . Throwing ENFE in that case * As returning a boolean etc has other complications in terms of PR reattempt etc */ private void throwExceptionForSqlFire(EntryEventImpl event) { if (event.hasDelta() && _getOwner().getGemFireCache().isSqlfSystem()) { throw new EntryNotFoundException( "SqlFabric::No row found for update"); } }
/** * Asif: If the system is GemFireXD and the event has delta, then re == null * implies update on non existent row . Throwing ENFE in that case * As returning a boolean etc has other complications in terms of PR reattempt etc */ private void throwExceptionForGemFireXD(EntryEventImpl event) { if (event.hasDeltaPut() && _getOwner().getGemFireCache().isGFXDSystem()) { throw new EntryNotFoundException( "GemFireXD::No row found for update"); } }
/** * used for instantiation of a profile associated with a region and * not describing region filters in a different process. Do not use * this method when instantiating profiles to store in distribution * advisor profiles. * @param r */ public FilterProfile(LocalRegion r) { this.region = r; this.isLocalProfile = true; this.memberID = region.getMyId(); this.cqCount = new AtomicInteger(); this.logger = r.getCache().getLoggerI18n(); this.clientMap = new IDMap(); this.cqMap = new IDMap(); this.localProfile.hasCacheServer = (r.getGemFireCache().getCacheServers().size() > 0); }
private static void closeRegion(Region r) { LocalRegion lr = (LocalRegion)r; r.close(); lr.getDiskStore().close(); lr.getGemFireCache().removeDiskStore(lr.getDiskStore()); } private static void destroyRegion(Region r) {
private void close(LocalRegion lr) { lr.close(); lr.getDiskStore().close(); lr.getGemFireCache().removeDiskStore(lr.getDiskStore()); }
private static void destroyRegion(Region r) { LocalRegion lr = (LocalRegion)r; r.destroyRegion(); lr.getDiskStore().close(); lr.getGemFireCache().removeDiskStore(lr.getDiskStore()); } /**
public void scheduleTombstone(RegionEntry entry, VersionTag destroyedVersion) { if (destroyedVersion == null) { throw new NullPointerException("destroyed version tag cannot be null"); } // Object sync = TombstoneService.DEBUG_TOMBSTONE_COUNT? TombstoneService.debugSync : new Object(); // lastUnscheduled.set(null); // synchronized(sync) { incTombstoneCount(1); // if (entry instanceof AbstractRegionEntry) { // AbstractRegionEntry are = (AbstractRegionEntry)entry; // if (are.isTombstoneScheduled()) { // log.severe(LocalizedStrings.DEBUG, "Scheduling a tombstone for an entry that is already a tombstone: " + entry, new Exception("stack trace")); // throw new IllegalStateException("Attempt to schedule a tombstone for a destroyed entry that is already scheduled for expiration"); // } // are.setTombstoneScheduled(true); // } if (logger.isTraceEnabled(LogMarker.TOMBSTONE_COUNT)) { logger.trace(LogMarker.TOMBSTONE_COUNT, "scheduling tombstone for {} version={} count is {} entryMap size is {}", entry.getKey(), entry.getVersionStamp().asVersionTag(), this.tombstoneCount.get(), this.entries.size()/*, new Exception("stack trace")*/); // this can be useful for debugging tombstone count problems if there aren't a lot of concurrent threads // if (TombstoneService.DEBUG_TOMBSTONE_COUNT && this.entries instanceof AbstractRegionMap) { // ((AbstractRegionMap)this.entries).verifyTombstoneCount(tombstoneCount); // } } getGemFireCache().getTombstoneService().scheduleTombstone(this, entry, destroyedVersion); // } }
@Override protected void closeDown() { DiskRegion dr = null; if (region != null) { dr = ((LocalRegion)region).getDiskRegion(); } super.closeDown(); if (dr != null) { dr.getDiskStore().close(); ((LocalRegion) region).getGemFireCache().removeDiskStore(dr.getDiskStore()); } }
getGemFireCache().getTombstoneService().scheduleTombstone(this, entry, destroyedVersion);
@Override public void validateExecution(Function function, Set targetMembers) { GemFireCacheImpl cache = region.getGemFireCache(); if (cache != null && cache.getTxManager().getTXState() != null) { if (targetMembers.size() > 1) { throw new TransactionException(LocalizedStrings.PartitionedRegion_TX_FUNCTION_ON_MORE_THAN_ONE_NODE .toLocalizedString()); } else { assert targetMembers.size() == 1; DistributedMember funcTarget = (DistributedMember)targetMembers.iterator().next(); DistributedMember target = cache.getTxManager().getTXState().getTarget(); if (target == null) { cache.getTxManager().getTXState().setTarget(funcTarget); } else if (!target.equals(funcTarget)) { throw new TransactionDataNotColocatedException(LocalizedStrings.PartitionedRegion_TX_FUNCTION_EXECUTION_NOT_COLOCATED_0_1 .toLocalizedString(new Object[] {target,funcTarget})); } } } if (!MemoryThresholds.isLowMemoryExceptionDisabled() && function.optimizeForWrite()) { try { region.checkIfAboveThreshold(null); } catch (LowMemoryException e) { Set<DistributedMember> htrm = region.getMemoryThresholdReachedMembers(); throw new LowMemoryException(LocalizedStrings.ResourceManager_LOW_MEMORY_FOR_0_FUNCEXEC_MEMBERS_1.toLocalizedString( new Object[] {function.getId(), htrm}), htrm); } } }
private void invokeCacheWriter(RegionEntry re, EntryEventImpl event, boolean cacheWrite, CacheWriter cacheWriter, Set netWriteRecipients, boolean requireOldValue, Object expectedOldValue, boolean replaceOnClient) { // invoke listeners only if region is initialized if (_getOwner().isInitialized() && cacheWrite) { // event.setOldValue already called in setOldValueInEvent // bug #42638 for replaceOnClient, do not make the event create // or update since replace must propagate to server if (!replaceOnClient) { if (re.isDestroyedOrRemoved()) { event.makeCreate(); } else { event.makeUpdate(); } } _getOwner().cacheWriteBeforePut(event, netWriteRecipients, cacheWriter, requireOldValue, expectedOldValue); } if (!_getOwner().getGemFireCache().isGFXDSystem()) { // to fix bug 48763 keep the old value referenced if xd. xd needs the old value. if (!_getOwner().isInitialized() && !cacheWrite && !event.hasDelta()) { // block setting of old value in putNewValueNoSync, don't // need it event.oldValueNotAvailable(); } } }