Package lupos.datastructures.sort.helper

Examples of lupos.datastructures.sort.helper.InitialRunGenerator


    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();
      }
View Full Code Here


    final BoundedBuffer<Run> initialRunsLevel0 = new BoundedBuffer<Run>(Math.max(this.NUMBER_INITIAL_RUN_GENERATION_THREADS, this.NUMBER_OF_RUNS_TO_JOIN)*3);
   
    InitialRunGenerator[] initialRunGenerationThreads = new InitialRunGenerator[this.NUMBER_INITIAL_RUN_GENERATION_THREADS];
   
    for(int i=0; i<this.NUMBER_INITIAL_RUN_GENERATION_THREADS; i++){
      initialRunGenerationThreads[i] = new InitialRunGenerator(buffer, initialRunsLevel0, this.NUMBER_ELEMENTS_IN_INITIAL_RUNS, this.runs);
      initialRunGenerationThreads[i].start();
    }
   
    // start the merge thread...
    final ArrayList<LinkedList<Run>> levels = new ArrayList<LinkedList<Run>>();
View Full Code Here

TOP

Related Classes of lupos.datastructures.sort.helper.InitialRunGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.