Search in sources :

Example 16 with ConcurrentParallelGatewaySenderQueue

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);
    }
}
Also used : GatewaySender(org.apache.geode.cache.wan.GatewaySender) ConcurrentParallelGatewaySenderQueue(org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderQueue) RegionQueue(org.apache.geode.internal.cache.RegionQueue)

Aggregations

ConcurrentParallelGatewaySenderQueue (org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderQueue)16 GatewaySender (org.apache.geode.cache.wan.GatewaySender)8 AbstractGatewaySender (org.apache.geode.internal.cache.wan.AbstractGatewaySender)7 RegionQueue (org.apache.geode.internal.cache.RegionQueue)5 AbstractGatewaySenderEventProcessor (org.apache.geode.internal.cache.wan.AbstractGatewaySenderEventProcessor)5 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)3 ArrayList (java.util.ArrayList)2 Set (java.util.Set)2 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)2 BucketRegion (org.apache.geode.internal.cache.BucketRegion)2 GatewaySenderEventImpl (org.apache.geode.internal.cache.wan.GatewaySenderEventImpl)2 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 CancelException (org.apache.geode.CancelException)1