@@ -851,7 +851,7 @@ public static Object rebalanceTopic(int idx) {
851851 // Finish all exchange futures.
852852 ExchangeFutureSet exchFuts0 = exchFuts ;
853853
854- for (CachePartitionExchangeWorkerTask task : exchWorker ) {
854+ for (CachePartitionExchangeWorkerTask task : exchWorker . queuedElements () ) {
855855 if (task instanceof GridDhtPartitionsExchangeFuture )
856856 ((GridDhtPartitionsExchangeFuture )task ).onDone (stopErr );
857857 }
@@ -2445,7 +2445,7 @@ public boolean mergeExchanges(final GridDhtPartitionsExchangeFuture curFut, Grid
24452445 if (exchWorker .waitForExchangeFuture (resVer ))
24462446 return true ;
24472447
2448- for (CachePartitionExchangeWorkerTask task : exchWorker ) {
2448+ for (CachePartitionExchangeWorkerTask task : exchWorker . queuedElements () ) {
24492449 if (task instanceof GridDhtPartitionsExchangeFuture ) {
24502450 GridDhtPartitionsExchangeFuture fut = (GridDhtPartitionsExchangeFuture )task ;
24512451
@@ -2525,7 +2525,7 @@ public boolean mergeExchangesOnCoordinator(
25252525 synchronized (curFut .mutex ()) {
25262526 int awaited = 0 ;
25272527
2528- for (CachePartitionExchangeWorkerTask task : exchWorker ) {
2528+ for (CachePartitionExchangeWorkerTask task : exchWorker . queuedElements () ) {
25292529 if (task instanceof GridDhtPartitionsExchangeFuture ) {
25302530 GridDhtPartitionsExchangeFuture fut = (GridDhtPartitionsExchangeFuture )task ;
25312531
@@ -2624,7 +2624,7 @@ private void waitForTestVersion(AffinityTopologyVersion exchMergeTestWaitVer, Gr
26242624 while (U .currentTimeMillis () < end ) {
26252625 boolean found = false ;
26262626
2627- for (CachePartitionExchangeWorkerTask task : exchWorker ) {
2627+ for (CachePartitionExchangeWorkerTask task : exchWorker . queuedElements () ) {
26282628 if (task instanceof GridDhtPartitionsExchangeFuture ) {
26292629 GridDhtPartitionsExchangeFuture fut = (GridDhtPartitionsExchangeFuture )task ;
26302630
@@ -2864,7 +2864,7 @@ private void removeMergedFutures(AffinityTopologyVersion resVer, GridDhtPartitio
28642864 if (resVer .compareTo (exchFut .initialVersion ()) != 0 ) {
28652865 waitForExchangeFuture (resVer );
28662866
2867- for (CachePartitionExchangeWorkerTask task : this ) {
2867+ for (CachePartitionExchangeWorkerTask task : queuedElements () ) {
28682868 if (task instanceof GridDhtPartitionsExchangeFuture ) {
28692869 GridDhtPartitionsExchangeFuture fut0 = (GridDhtPartitionsExchangeFuture )task ;
28702870
@@ -2914,7 +2914,7 @@ void processCustomTask(CachePartitionExchangeWorkerTask task) {
29142914 */
29152915 boolean hasPendingExchange () {
29162916 if (!isQueueEmpty ()) {
2917- for (CachePartitionExchangeWorkerTask task : this ) {
2917+ for (CachePartitionExchangeWorkerTask task : queuedElements () ) {
29182918 if (isExchangeTask (task ))
29192919 return true ;
29202920 }
@@ -2928,7 +2928,7 @@ boolean hasPendingExchange() {
29282928 */
29292929 boolean hasPendingServerExchange () {
29302930 if (!isQueueEmpty ()) {
2931- for (CachePartitionExchangeWorkerTask task : this ) {
2931+ for (CachePartitionExchangeWorkerTask task : queuedElements () ) {
29322932 if (task instanceof GridDhtPartitionsExchangeFuture ) {
29332933 if (((GridDhtPartitionsExchangeFuture )task ).changedAffinity ())
29342934 return true ;
@@ -2948,7 +2948,7 @@ void dumpExchangeDebugInfo() {
29482948 if (DIAGNOSTIC_WARN_LIMIT > 0 ) {
29492949 int cnt = 0 ;
29502950
2951- for (CachePartitionExchangeWorkerTask task : this ) {
2951+ for (CachePartitionExchangeWorkerTask task : queuedElements () ) {
29522952 if (task instanceof GridDhtPartitionsExchangeFuture ) {
29532953 U .warn (log , ">>> " + ((GridDhtPartitionsExchangeFuture )task ).shortInfo ());
29542954
0 commit comments