use of org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask in project ignite by apache.
the class PendingExchangeTest method waitForExchnagesBegin.
/**
* Waiting for exchanges beginning.
*
* @param ignite Ignite.
*/
private void waitForExchnagesBegin(GridCachePartitionExchangeManager exchangeManager, int exchanges) {
GridWorker exchWorker = U.field(exchangeManager, "exchWorker");
Queue<CachePartitionExchangeWorkerTask> exchnageQueue = U.field(exchWorker, "futQ");
try {
assertTrue(GridTestUtils.waitForCondition(() -> {
int exFuts = 0;
for (CachePartitionExchangeWorkerTask task : exchnageQueue) {
if (task instanceof GridDhtPartitionsExchangeFuture)
exFuts++;
}
return exFuts >= exchanges;
}, 30_000));
} catch (IgniteInterruptedCheckedException e) {
fail("Can’t wait for the exchnages beginning.");
}
}
Aggregations