/** * {@inheritDoc} */ @Override public String toString() { return String.format("%s{cacheName=%s, entry=%s}", getClass().getName(), getCacheName(), getEntry()); } }
/** * {@inheritDoc} */ @Override public Event transform(Event event) { if (event instanceof DistributableEntryEvent) { DistributableEntryEvent distributableEntryEvent = (DistributableEntryEvent) event; distributableEntryEvent.getEntry().setOriginalBinaryValue(null); return distributableEntryEvent; } else { return event; } } }
/** * Extracts the {@link ClusterMetaInfo} of the {@link Cluster} from where the {@link EntryEvent} originated. * * @param entryEvent The {@link DistributableEntryEvent} from which to determine the {@link ClusterMetaInfo}. * * @return {@link ClusterMetaInfo} */ @SuppressWarnings({"rawtypes"}) private ClusterMetaInfo getSourceClusterMetaInfo(DistributableEntryEvent entryEvent) { Binary binaryValue = entryEvent.getEntry().getBinaryValue(); Map decorations = binaryValue == null ? null : (Map) entryEvent.getEntry().getContext().getInternalValueDecoration(binaryValue, BackingMapManagerContext .DECO_CUSTOM); if (decorations == null) { throw new IllegalStateException("Can't extract the CLUSTER_INFO_DECORATION_KEY from the EntryEvent. The BinaryValue is not decorated"); } ClusterMetaInfo sourceClusterMetaInfo = (ClusterMetaInfo) decorations.get(DistributableEntry.CLUSTER_META_INFO_DECORATION_KEY); if (sourceClusterMetaInfo == null) { throw new IllegalStateException("Expecting a non-null value for CLUSTER_INFO_DECORATION_KEY"); } return sourceClusterMetaInfo; }
/** * {@inheritDoc} */ @Override public boolean evaluate(Object object) { if (object instanceof DistributableEntryEvent) { DistributableEntryEvent e = (DistributableEntryEvent) object; SimpleMapEntry entry = new SimpleMapEntry(e.getEntry().getKey(), e.getEntry().getOriginalValue()); return m_filter.evaluateEntry(entry); } else { return false; } } }
entryEvent.getEntry().setContext(context);
namedCache.invoke(entryEvent.getEntry().getBinaryKey(), new EntryEventProcessor(entryEvent, conflictResolverBuilder,
((DistributableEntryEvent) entryEvent).getEntry().setContext(context);
DistributableEntry entry = ((DistributableEntryEvent) e).getEntry(); Binary binKey = entry.getBinaryKey(); int iPartition = getCacheService().getBackingMapManager().getContext().getKeyPartition(binKey);
@Override public Event transform(Event event) { if ( event instanceof DistributableEntryEvent) { DistributableEntryEvent distributableEntryEvent = (DistributableEntryEvent) event; NamedCache namedCache = CacheFactory.getCache(distributableEntryEvent.getCacheName()); distributableEntryEvent.getEntry() .setContext(namedCache.getCacheService() .getBackingMapManager() .getContext()); return distributableEntryEvent; } else { return event; } } }).transform(eventList.iterator());
entryEvent.getEntry().setContext(targetEntry.getContext()); targetEntry.updateBinaryValue((Binary) entryEvent.getEntry().getBinaryValue()); long expiry = entryEvent.getEntry().getExpiry(); Binary binaryValue = entryEvent.getEntry().getBinaryValue(); Map srcDecorations = binaryValue == null ? new HashMap()