Search in sources :

Example 1 with ParallelGatewaySenderEventProcessor

use of org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderEventProcessor in project geode by apache.

the class RemoteConcurrentParallelGatewaySenderEventProcessor method rebalance.

@Override
protected void rebalance() {
    GatewaySenderStats statistics = this.sender.getStatistics();
    long startTime = statistics.startLoadBalance();
    try {
        for (ParallelGatewaySenderEventProcessor parallelProcessor : this.processors) {
            GatewaySenderEventRemoteDispatcher remoteDispatcher = (GatewaySenderEventRemoteDispatcher) parallelProcessor.getDispatcher();
            if (remoteDispatcher.isConnectedToRemote()) {
                remoteDispatcher.stopAckReaderThread();
                remoteDispatcher.destroyConnection();
            }
        }
    } finally {
        statistics.endLoadBalance(startTime);
    }
}
Also used : GatewaySenderStats(org.apache.geode.internal.cache.wan.GatewaySenderStats) GatewaySenderEventRemoteDispatcher(org.apache.geode.internal.cache.wan.GatewaySenderEventRemoteDispatcher) ParallelGatewaySenderEventProcessor(org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderEventProcessor)

Example 2 with ParallelGatewaySenderEventProcessor

use of org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderEventProcessor in project geode by apache.

the class WANTestBase method verifyAndGetEventsDispatchedByConcurrentDispatchers.

public static int verifyAndGetEventsDispatchedByConcurrentDispatchers(final String senderId) {
    Set<GatewaySender> senders = cache.getGatewaySenders();
    GatewaySender sender = null;
    for (GatewaySender s : senders) {
        if (s.getId().equals(senderId)) {
            sender = s;
            break;
        }
    }
    ConcurrentParallelGatewaySenderEventProcessor cProc = (ConcurrentParallelGatewaySenderEventProcessor) ((AbstractGatewaySender) sender).getEventProcessor();
    if (cProc == null)
        return 0;
    int totalDispatched = 0;
    for (ParallelGatewaySenderEventProcessor lProc : cProc.getProcessors()) {
        totalDispatched += lProc.getNumEventsDispatched();
    }
    assertTrue(totalDispatched > 0);
    return totalDispatched;
}
Also used : GatewaySender(org.apache.geode.cache.wan.GatewaySender) ConcurrentParallelGatewaySenderEventProcessor(org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderEventProcessor) ConcurrentParallelGatewaySenderEventProcessor(org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderEventProcessor) ParallelGatewaySenderEventProcessor(org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderEventProcessor)

Aggregations

ParallelGatewaySenderEventProcessor (org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderEventProcessor)2 GatewaySender (org.apache.geode.cache.wan.GatewaySender)1 GatewaySenderEventRemoteDispatcher (org.apache.geode.internal.cache.wan.GatewaySenderEventRemoteDispatcher)1 GatewaySenderStats (org.apache.geode.internal.cache.wan.GatewaySenderStats)1 ConcurrentParallelGatewaySenderEventProcessor (org.apache.geode.internal.cache.wan.parallel.ConcurrentParallelGatewaySenderEventProcessor)1