question: private void awaitOperationsAvailable ( ) throws InterruptedException { flushLock . lock ( ) ; try { do { if ( writeCache . sizex ( ) <= cacheMaxSize || cacheMaxSize == 0 ) { if ( cacheFlushFreq > 0 ) canFlush . await ( cacheFlushFreq , TimeUnit . MILLISECONDS ) ; else canFlush . await ( ) ; } } while ( writeCache . sizex ( ) == 0 && ! stopping . get ( ) ) ; } finally { flushLock . unlock ( ) ; } }
target:  This method awaits until enough elements in map are available or given timeout is over.