final BoundedBuffer<String> buffer = new BoundedBuffer<String>();
// initialize threads for generating initial runs
final BoundedBuffer<Run> initialRunsLevel0 = new BoundedBuffer<Run>(NUMBER_OF_RUNS_IN_BUFFER_FOR_SWAPPING);
final InitialRunGenerator initialRunGenerationThread = new InitialRunGenerator(buffer, initialRunsLevel0, this.NUMBER_ELEMENTS_IN_INITIAL_RUNS, this.runs);
initialRunGenerationThread.start();
// start the swap thread...
final Swapper swapper = new Swapper(initialRunsLevel0);
swapper.start();
// read in and parse the data...
DataToBoundedBuffer.dataToBoundedBuffer(dataFiles, format, buffer);
// signal that all the data is parsed (and nothing will be put into the buffer any more)
buffer.endOfData();
// wait for threads to finish generating initial runs...
try {
initialRunGenerationThread.join();
} catch (final InterruptedException e) {
System.err.println(e);
e.printStackTrace();
}