albertogpz commented on a change in pull request #4928:
URL: https://github.com/apache/geode/pull/4928#discussion_r411879596



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
##########
@@ -410,6 +441,53 @@ public Object peek() throws CacheException {
     // so no need to worry about off-heap refCount.
   }
 
+  private void peekEventsFromIncompleteTransactions(List<AsyncEvent> batch,

Review comment:
       You are right, the code is very similar (just as it happens with the 
peek method) but the structures on which they operate are different:
   On the SerialGatewaySenderQueue it operates on a set of transactionIds while 
on the ParallelGatewaySenderQueue it operates on a map of <TransactionId, 
bucketId>.
   
   Besides, the difference between the Serial queue and the parallel queue 
makes it different the access to them. On the parallel you need to pass the 
bucketId and the partition region. On the serial one, you need to pass the last 
accessed key so that you do not go through the same elements over and over 
because those are not removed immediately when peeked from the queue as it 
happens with the parallel queue.
   
   As a consequence I did not find an easy way to reuse code that did end up 
making things more complex.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to