Package lupos.datastructures.sort.sorter

Examples of lupos.datastructures.sort.sorter.Sorter


    SORTER sorter = SORTER.valueOf(args[0]);
    if(sorter==null){
      System.out.println(Sort.getHelpText());
      return;
    }
    Sorter algo = sorter.createInstance(args, 4);
    if(algo==null){
      System.out.println(Sort.getHelpText());
      return;
    }

    final int times = Integer.parseInt(args[3]);

    // just to use for deleting temporary files...
    // final File file = new File("");
    // final String absolutePath = file.getAbsolutePath() + File.separator;

    System.out.println("\nParameters:\n-----------\nMain Strategy:" + sorter.name() + "\n" + algo.parametersToString() + "\n");

    final long[] execution_times = new long[times];
    long total_time = 0;
    for(int t=0; t<times; t++){
      sorter = SORTER.valueOf(args[0]);
      if(sorter==null){
        System.out.println(Sort.getHelpText());
        return;
      }
      algo = sorter.createInstance(args, 4);
      if(algo==null){
        System.out.println(Sort.getHelpText());
        return;
      }

      final Date start = new Date();
      System.out.println("\n"+t+": Start processing:"+start+"\n");

      final Run result = algo.sort(new BufferedInputStream(new FileInputStream(args[1])), args[2]);

      // just access all elements in the bag by iterating one time through
      final Iterator<String> it = result.iterator();
      long i=0;
      while(it.hasNext()){
        it.next();
        i++;
        // System.out.println((++i)+":"+it.next());
      }
      result.release();
      final Date end = new Date();

      System.out.println("\n"+t+": End processing:"+end);
      System.out.println("\nNumber of sorted RDF terms/Strings:"+i);
      System.out.println("Number of runs swapped to disk:" + algo.getNumberOfRunsOnDisk());

      execution_times[t] = end.getTime()-start.getTime();
      total_time += execution_times[t];

      DiskCollection.removeCollectionsFromDisk();
View Full Code Here

TOP

Related Classes of lupos.datastructures.sort.sorter.Sorter

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.