public void prepare ( Collection < String > surts ) { List < String > safeSurts = new ArrayList < String > ( surts ) ; FetchThread threads [ ] = new FetchThread [ PREPARE_THREAD_COUNT ] ; for ( int i = 0 ; i < PREPARE_THREAD_COUNT ; i ++ ) { threads [ i ] = new FetchThread ( safeSurts ) ; threads [ i ] . start ( ) ; } for ( int i = 0 ; i < PREPARE_THREAD_COUNT ; i ++ ) { try { threads [ i ] . join ( ) ; } catch ( InterruptedException e ) { } } }
Prepare the cache to lookup info for a given set of surts . The fetches happen in parallel so this also makes a good option for speeding up bulk lookups .