use of org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderQueue in project geode by apache.
the class WANTestBase method testQueueSize.
public static void testQueueSize(String senderId, int numQueueEntries) {
GatewaySender sender = null;
for (GatewaySender s : cache.getGatewaySenders()) {
if (s.getId().equals(senderId)) {
sender = s;
break;
}
}
if (sender.isParallel()) {
int totalSize = 0;
Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
for (RegionQueue q : queues) {
ConcurrentParallelGatewaySenderQueue prQ = (ConcurrentParallelGatewaySenderQueue) q;
totalSize += prQ.size();
}
assertEquals(numQueueEntries, totalSize);
} else {
Set<RegionQueue> queues = ((AbstractGatewaySender) sender).getQueues();
int size = 0;
for (RegionQueue q : queues) {
size += q.size();
}
assertEquals(numQueueEntries, size);
}
}
Aggregations