protected synchronized void applyEntries ( boolean blocking ) throws IOException { if ( blocking ) { /* Blocking Mode */ synchronized ( _entryApply ) { List < Entry < V >> entryList = new ArrayList < Entry < V > > ( ) ; while ( _entryPool . getServiceQueueSize ( ) > 0 ) { Entry < V > entry = _entryPool . pollFromService ( ) ; if ( entry != null ) entryList . add ( entry ) ; } applyEntries ( entryList ) ; } } else { /* Non-Blocking Mode */ synchronized ( _entryApply ) { for ( int i = 0 ; i < _maxEntries ; i ++ ) { Entry < V > entry = _entryPool . pollFromService ( ) ; if ( entry != null ) _entryApply . add ( entry ) ; } } // Start a separate thread to update the underlying array file new Thread ( _entryApply ) . start ( ) ; } }
Apply accumulated entries to the array file .