davebarnes97 commented on a change in pull request #5968:
URL: https://github.com/apache/geode/pull/5968#discussion_r568887048



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -870,6 +843,51 @@ public boolean put(Object object) throws 
InterruptedException, CacheException {
     return putDone;
   }
 
+  private String getRegionPath(GatewaySenderEventImpl value, boolean 
isDREvent, String regionPath) {
+    boolean isDebugEnabled = logger.isDebugEnabled();
+    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
+      return null;
+    }
+    return regionPath;
+  }
+
+  private Object getKeyFromObject(boolean isDebugEnabled, 
GatewaySenderEventImpl value,
+      boolean isDREvent) {
+    Object key;
+    if (!isDREvent) {
+      key = value.getShadowKey();
+
+      if ((Long) key == -1) {
+        // In case of parallel we don't expect

Review comment:
       Two statements that I find unclear. 
   First: "In case of parallel we don't expect the key to be not set. 
   Suggested improvement: "In the parallel case, we expect the key to be set."
   Second: "If it is the case then the event must be coming through listener, 
so return."
   Suggested improvement: "If the key is not set, then the event must be coming 
through listener, so return."
   (Note: because "it is the case" was unclear to me, I may have stated the 
condition incorrectly. Please make sure the statement matches the code's 
behavior.
   Could be clearer. Suggestion
   




----------------------------------------------------------------
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]


Reply via email to