davebarnes97 commented on a change in pull request #5968:
URL: https://github.com/apache/geode/pull/5968#discussion_r568878831
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java
##########
@@ -1134,6 +1144,9 @@ private void recordDroppedEvent(EntryEventImpl event) {
logger.debug("added to tmpDroppedEvents event: {}", event);
}
}
+ if (logger.isDebugEnabled()) {
+ logger.debug("Returning back without putting into the gateway sender
queue:" + event);
Review comment:
"Returning back" is redundant, better to just say "Returning"
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
##########
@@ -173,14 +174,25 @@ public int getTotalQueueSize() {
protected abstract void initializeMessageQueue(String id, boolean
cleanQueues);
- public void enqueueEvent(EnumListenerEvent operation, EntryEvent event,
+ public boolean enqueueEvent(EnumListenerEvent operation, EntryEvent event,
Object substituteValue) throws IOException, CacheException {
- enqueueEvent(operation, event, substituteValue, false);
+ return enqueueEvent(operation, event, substituteValue, false, null);
}
- public abstract void enqueueEvent(EnumListenerEvent operation, EntryEvent
event,
- Object substituteValue, boolean isLastEventInTransaction) throws
IOException, CacheException;
-
+ /**
+ *
+ * @param operation The operation
+ * @param event The event to be put in the queue
+ * @param substituteValue The substitute value
+ * @param isLastEventInTransaction True if this event is the last one in the
+ * transaction it belongs to
+ * @param condition If not null, the event will be enqueued only if the
predicate
+ * matches at least with one elements in the queue
Review comment:
"matches at least with one elements" -> "matches at least one element"
##########
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",
Review comment:
Unclear statement: "the region for which this event originated is not
yet configured in the GatewaySender".
Do you mean "the region for which this event originated _must first be
configured_ in the GatewaySender"?
Or maybe "the region _from_ which this event originated _must first be
configured_ in the GatewaySender"?
##########
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]