@Test public void putThrowsIOExceptionOnMissingRegion() throws Exception { thrown.expect(IOException.class); // Mocks with minimal implementation to ensure code path through PutMessage.toData EntryEventImpl mockEvent = mock(EntryEventImpl.class); when(mockEvent.isPossibleDuplicate()).thenReturn(false); when(mockEvent.getEventId()).thenReturn(mock(EventID.class)); when(mockEvent.getOperation()).thenReturn(Operation.UPDATE); when(mockEvent.getDeltaBytes()).thenReturn(new byte[] {}); DistributionConfig mockDistributionConfig = mock(DistributionConfig.class); when(mockDistributionConfig.getDeltaPropagation()).thenReturn(true); InternalDistributedSystem mockInternalDistributedSystem = mock(InternalDistributedSystem.class); when(mockInternalDistributedSystem.getConfig()).thenReturn(mockDistributionConfig); // Construct a put with minimum configuration needed to reach region check. PutMessage put = new PutMessage(new HashSet(), false, UNKNOWN_REGION, null, mockEvent, 0, false, false, null, false); put.setSendDelta(true); put.setInternalDs(mockInternalDistributedSystem); put.toData(new DataOutputStream(new ByteArrayOutputStream())); } }
/** * generate version tag if it does not exist and set it into the event. */ @Override public void generateAndSetVersionTag(InternalCacheEvent event, RegionEntry entry) { if (entry != null && event.getOperation().isEntry()) { EntryEventImpl entryEvent = (EntryEventImpl) event; if (!entryEvent.isOriginRemote() && shouldGenerateVersionTag(entry, entryEvent)) { boolean eventHasDelta = getSystem().getConfig().getDeltaPropagation() && !this.scope.isDistributedNoAck() && entryEvent.getDeltaBytes() != null; VersionTag v = entry.generateVersionTag(null, eventHasDelta, this, entryEvent); if (logger.isDebugEnabled() && v != null) { logger.debug("generated version tag {} for {}", v, entryEvent.getKey()); } } } }
private void setDeltaFlag(DistributedRegion region) { try { if (region != null && region.getSystem().getConfig().getDeltaPropagation() && this.sendDelta && !region.scope.isDistributedNoAck() && this.event.getDeltaBytes() != null) { setHasDelta(true); return; } setHasDelta(false); } catch (RuntimeException re) { throw new InvalidDeltaException( "Caught exception while sending delta. ", re); } }
Set adviseCacheServers; Set<InternalDistributedMember> cachelessNodesWithNoCacheServer = new HashSet<>(); if (region.getDistributionConfig().getDeltaPropagation() && this.supportsDeltaPropagation()) { cachelessNodes = region.getCacheDistributionAdvisor().adviseEmptys(); if (!cachelessNodes.isEmpty()) {
dos.writeBoolean(((InternalDistributedSystem) this.system).getConfig().getDeltaPropagation());
PartitionedRegion region = null; try { boolean flag = internalDs.getConfig().getDeltaPropagation(); if (this.event.getDeltaBytes() != null && flag && this.sendDelta) { this.hasDelta = true;
boolean createDurableQueue = proxy.proxyID.isDurable(); boolean canHandleDelta = (proxy.clientVersion.compareTo(Version.GFE_61) >= 0) && InternalDistributedSystem.getAnyInstance().getConfig().getDeltaPropagation() && !(this._proxy.clientConflation == Handshake.CONFLATION_ON); if ((createDurableQueue || canHandleDelta) && logger.isDebugEnabled()) {
private void setDeltaIfNeeded(EntryEventImpl event) { if (this.partitionedRegion.getSystem().getConfig().getDeltaPropagation() && event.getOperation().isUpdate() && event.getDeltaBytes() == null) { @Unretained
if (getSystem().getConfig().getDeltaPropagation() && value instanceof Delta) { boolean extractDelta = false; if (!this.hasServerProxy()) {
security.putAll(other.getSecurityProps()); removeUnresponsiveClient = other.getRemoveUnresponsiveClient(); deltaPropagation = other.getDeltaPropagation(); distributedSystemId = other.getDistributedSystemId(); redundancyZone = other.getRedundancyZone();
gemFirePropertyData.setDeltaPropagation(config.getDeltaPropagation()); gemFirePropertyData.setRedundancyZone(config.getRedundancyZone()); gemFirePropertyData.setEnforceUniqueHost(config.getEnforceUniqueHost());