public static void stressTestDirectory(Directory dir, String testLabel) throws InterruptedException, IOException {
SharedState state = new SharedState(DICTIONARY_SIZE);
CacheTestSupport.initializeDirectory(dir);
ExecutorService e = Executors.newFixedThreadPool(READER_THREADS + WRITER_THREADS);
for (int i = 0; i < READER_THREADS; i++) {
e.execute(new LuceneReaderThread(dir, state));
}
for (int i = 0; i < WRITER_THREADS; i++) {
e.execute(new LuceneWriterThread(dir, state));
}
e.shutdown();