private void waitForIteratorsCleared(IgniteCache<String,Integer> cache,int secs) throws InterruptedException {
  for (int i=0; i < secs; i++) {
    try {
      cache.size();
      checkIteratorsCleared();
    }
 catch (    AssertionFailedError e) {
      if (i == 9) {
        for (int j=0; j < gridCount(); j++)         executeOnLocalOrRemoteJvm(j,new PrintIteratorStateTask());
        throw e;
      }
      log.info("Iterators not cleared, will wait");
      Thread.sleep(1000);
    }
  }
}

private void waitForIteratorsCleared ( IgniteCache < String , Integer > cache , int secs ) throws InterruptedException { for ( int i = 0 ; i < secs ; i ++ ) { try { cache . size ( ) ; checkIteratorsCleared ( ) ; } catch ( AssertionFailedError e ) { if ( i == 9 ) { for ( int j = 0 ; j < gridCount ( ) ; j ++ ) executeOnLocalOrRemoteJvm ( j , new PrintIteratorStateTask ( ) ) ; throw e ; } log . info ( "Iterators not cleared, will wait" ) ; Thread . sleep ( 1000 ) ; } } }
checks iterators are cleared .
