protected DistributedRegion getRegion() { return (DistributedRegion) this.event.getRegion(); }
private void removeDestroyTokensFromCqResultKeys(InternalCacheEvent event, FilterInfo filterInfo) { FilterProfile regionProfile = ((LocalRegion) event.getRegion()).getFilterProfile(); if (event.getOperation().isEntry() && filterInfo.getCQs() != null) { EntryEventImpl entryEvent = (EntryEventImpl) event; for (Map.Entry<Long, Integer> e : filterInfo.getCQs().entrySet()) { Long cqID = e.getKey(); String cqName = regionProfile.getRealCqID(cqID); if (cqName != null) { ServerCQ cq = regionProfile.getCq(cqName); if (cq != null && e.getValue().equals(Integer.valueOf(MessageType.LOCAL_DESTROY))) { cq.removeFromCqResultKeys(entryEvent.getKey(), true); } } } } }
/** * @return true if the event should not be tracked, false otherwise */ private boolean ignoreEvent(InternalCacheEvent event, EventID eventID) { if (eventID == null) { return true; } else { boolean isVersioned = (event.getVersionTag() != null); boolean isClient = event.hasClientOrigin(); if (isVersioned && isClient) { return false; // version tags for client events are kept for retries by the client } boolean isEntry = event.getOperation().isEntry(); boolean isPr = event.getRegion().getAttributes().getDataPolicy().withPartitioning() || ((LocalRegion) event.getRegion()).isUsedForPartitionedRegionBucket(); return (!isClient && // ignore if it originated on a server, and isEntry && // it affects an entry and !isPr); // is not on a PR } }
RegionVersionVector versionVector = ((LocalRegion) event.getRegion()).getVersionVector(); canonicalizeIDs(tag, versionVector);
FilterProfile regionProfile = ((LocalRegion) event.getRegion()).getFilterProfile(); if (filterInfo != null) {
@Override public void recordEvent(InternalCacheEvent event) { EventID eventID = event.getEventId(); if (ignoreEvent(event, eventID)) { return; // not tracked } LocalRegion lr = (LocalRegion) event.getRegion(); ThreadIdentifier membershipID = createThreadIDFromEvent(eventID); VersionTag tag = null; if (lr.getServerProxy() == null) { tag = event.getVersionTag(); RegionVersionVector v = ((LocalRegion) event.getRegion()).getVersionVector(); canonicalizeIDs(tag, v); } EventSequenceNumberHolder newEvh = new EventSequenceNumberHolder(eventID.getSequenceID(), tag); if (logger.isTraceEnabled()) { logger.trace("region event tracker recording {}", event); } recordSequenceNumber(membershipID, newEvh); // If this is a bulkOp, and concurrency checks are enabled, we need to // save the version tag in case we retry. // Make recordBulkOp version tag after recordSequenceNumber, so that recordBulkOpStart // in a retry bulk op would not incorrectly remove the saved version tag in // recordedBulkOpVersionTags if (lr.getConcurrencyChecksEnabled() && (event.getOperation().isPutAll() || event.getOperation().isRemoveAll()) && lr.getServerProxy() == null) { recordBulkOpEvent(event, membershipID); } }
RegionAttributes attr = this.event.getRegion().getAttributes(); if (attr.getConcurrencyChecksEnabled() && !attr.getDataPolicy().withReplication() && attr.getScope() != Scope.GLOBAL) {
RegionAttributes attr = this.event.getRegion().getAttributes(); if (attr.getConcurrencyChecksEnabled() && !attr.getDataPolicy().withReplication() && attr.getScope() != Scope.GLOBAL) {
@Override protected FilterRoutingInfo getRecipientFilterRouting(Set cacheOpRecipients) { // for putAll, we need to determine the routing information for each event and // create a consolidated routing object representing all events that can be // used for distribution CacheDistributionAdvisor advisor; LocalRegion region = (LocalRegion) this.event.getRegion(); if (region instanceof PartitionedRegion) { advisor = ((PartitionedRegion) region).getCacheDistributionAdvisor(); } else if (region.isUsedForPartitionedRegionBucket()) { advisor = ((BucketRegion) region).getPartitionedRegion().getCacheDistributionAdvisor(); } else { advisor = ((DistributedRegion) region).getCacheDistributionAdvisor(); } FilterRoutingInfo consolidated = new FilterRoutingInfo(); for (int i = 0; i < this.putAllData.length; i++) { @Unretained EntryEventImpl ev = getEventForPosition(i); if (ev != null) { FilterRoutingInfo eventRouting = advisor.adviseFilterRouting(ev, cacheOpRecipients); if (eventRouting != null) { consolidated.addFilterInfo(eventRouting); } putAllData[i].filterRouting = eventRouting; } } // we need to create routing information for each PUT event return consolidated; }
@Override protected FilterRoutingInfo getRecipientFilterRouting(Set cacheOpRecipients) { // for removeAll, we need to determine the routing information for each event and // create a consolidated routing object representing all events that can be // used for distribution CacheDistributionAdvisor advisor; LocalRegion region = (LocalRegion) this.event.getRegion(); if (region instanceof PartitionedRegion) { advisor = ((PartitionedRegion) region).getCacheDistributionAdvisor(); } else if (region.isUsedForPartitionedRegionBucket()) { advisor = ((BucketRegion) region).getPartitionedRegion().getCacheDistributionAdvisor(); } else { advisor = ((DistributedRegion) region).getCacheDistributionAdvisor(); } FilterRoutingInfo consolidated = new FilterRoutingInfo(); for (int i = 0; i < this.removeAllData.length; i++) { @Unretained EntryEventImpl ev = getEventForPosition(i); if (ev != null) { FilterRoutingInfo eventRouting = advisor.adviseFilterRouting(ev, cacheOpRecipients); if (eventRouting != null) { consolidated.addFilterInfo(eventRouting); } removeAllData[i].filterRouting = eventRouting; } } // we need to create routing information for each PUT event return consolidated; }
return entry.event; LocalRegion region = (LocalRegion) this.event.getRegion();
return entry.event; LocalRegion region = (LocalRegion) this.event.getRegion(); @Retained EntryEventImpl ev = EntryEventImpl.create(region, entry.getOp(), entry.getKey(),