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);
}
}
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;
}
Aggregations