albertogpz commented on a change in pull request #6052:
URL: https://github.com/apache/geode/pull/6052#discussion_r589350876
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -702,44 +704,15 @@ public boolean put(Object object) throws
InterruptedException, CacheException {
boolean isDREvent = isDREvent(sender.getCache(), value);
String regionPath = value.getRegionPath();
- if (!isDREvent) {
- Region region = sender.getCache().getRegion(regionPath, true);
- regionPath = ColocationHelper.getLeaderRegion((PartitionedRegion)
region).getFullPath();
- }
- if (isDebugEnabled) {
- logger.debug("Put is for the region {}", regionPath);
- }
- if (!this.userRegionNameToShadowPRMap.containsKey(regionPath)) {
- if (isDebugEnabled) {
- logger.debug("The userRegionNameToshadowPRMap is {}",
userRegionNameToShadowPRMap);
- }
- logger.warn(
- "GatewaySender: Not queuing the event {}, as the region for which
this event originated is not yet configured in the GatewaySender",
- value);
- // does not put into queue
+ regionPath = getRegionPathForEventAndType(value, isDREvent, regionPath);
+ if (regionPath == null)
Review comment:
ok
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -702,44 +704,15 @@ public boolean put(Object object) throws
InterruptedException, CacheException {
boolean isDREvent = isDREvent(sender.getCache(), value);
String regionPath = value.getRegionPath();
- if (!isDREvent) {
- Region region = sender.getCache().getRegion(regionPath, true);
- regionPath = ColocationHelper.getLeaderRegion((PartitionedRegion)
region).getFullPath();
- }
- if (isDebugEnabled) {
- logger.debug("Put is for the region {}", regionPath);
- }
- if (!this.userRegionNameToShadowPRMap.containsKey(regionPath)) {
- if (isDebugEnabled) {
- logger.debug("The userRegionNameToshadowPRMap is {}",
userRegionNameToShadowPRMap);
- }
- logger.warn(
- "GatewaySender: Not queuing the event {}, as the region for which
this event originated is not yet configured in the GatewaySender",
- value);
- // does not put into queue
+ regionPath = getRegionPathForEventAndType(value, isDREvent, regionPath);
+ if (regionPath == null)
return false;
- }
PartitionedRegion prQ = this.userRegionNameToShadowPRMap.get(regionPath);
int bucketId = value.getBucketId();
- Object key = null;
- if (!isDREvent) {
- key = value.getShadowKey();
-
- if ((Long) key == -1) {
- // In case of parallel we don't expect
- // the key to be not set. If it is the case then the event must be
coming
- // through listener, so return.
- if (isDebugEnabled) {
- logger.debug("ParallelGatewaySenderOrderedQueue not putting key {} :
Value : {}", key,
- value);
- }
- // does not put into queue
- return false;
- }
- } else {
- key = value.getEventId();
- }
+ Object key = getKeyForEventAndType(value, isDREvent);
+ if (key == null)
Review comment:
ok
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]