Examples of QuickSort


Examples of org.apache.hadoop.util.QuickSort

      if (numPartitions > numRecords) {
        throw new IllegalArgumentException
          ("Requested more partitions than input keys (" + numPartitions +
           " > " + numRecords + ")");
      }
      new QuickSort().sort(this, 0, records.size());
      float stepSize = numRecords / (float) numPartitions;
      Text[] result = new Text[numPartitions-1];
      for(int i=1; i < numPartitions; ++i) {
        result[i-1] = records.get(Math.round(stepSize * i));
      }
View Full Code Here

Examples of org.apache.hadoop.util.QuickSort

  @Override
  public void sort(SelectionVector4 vector4, VectorContainer container){
    Stopwatch watch = new Stopwatch();
    watch.start();
    QuickSort qs = new QuickSort();
    qs.sort(this, 0, vector4.getTotalCount());
    logger.debug("Took {} us to sort {} records", watch.elapsed(TimeUnit.MICROSECONDS), vector4.getTotalCount());
  }
View Full Code Here

Examples of org.apache.hadoop.util.QuickSort

    doSetup(context, sampleBatch, null);
  }

  @Override
  public void sort(SelectionVector2 vector2, VectorContainer container){
    QuickSort qs = new QuickSort();
    qs.sort(this, 0, vector2.getCount());
  }
View Full Code Here

Examples of org.apache.hadoop.util.QuickSort

    doSetup(context, incoming, null);
  }

  @Override
  public void sort(SelectionVector2 vector2){
    QuickSort qs = new QuickSort();
    Stopwatch watch = new Stopwatch();
    watch.start();
    if (vector2.getCount() > 0) {
      qs.sort(this, 0, vector2.getCount());
    }
    logger.debug("Took {} us to sort {} records", watch.elapsed(TimeUnit.MICROSECONDS), vector2.getCount());
  }
View Full Code Here

Examples of org.apache.hadoop.util.QuickSort

    r.nextBytes(data);
    System.out.print("Data generated. ");
  }

  public long doSort(){
    QuickSort qs = new QuickSort();
    ByteSortable b = new ByteSortable();
    long nano = System.nanoTime();
    qs.sort(b, 0, RECORD_COUNT);
    return System.nanoTime() - nano;
  }
View Full Code Here

Examples of org.apache.hadoop.util.QuickSort

      if (numPartitions > numRecords) {
        throw new IllegalArgumentException
          ("Requested more partitions than input keys (" + numPartitions +
           " > " + numRecords + ")");
      }
      new QuickSort().sort(this, 0, records.size());
      float stepSize = numRecords / (float) numPartitions;
      Text[] result = new Text[numPartitions-1];
      for(int i=1; i < numPartitions; ++i) {
        result[i-1] = records.get(Math.round(stepSize * i));
      }
View Full Code Here

Examples of org.apache.hadoop.util.QuickSort

    if (memBlock.currentPtr <= 0) {
      return;
    }
    // quick sort the offsets
    OffsetSortable sortableObj = new OffsetSortable(memBlock, kvbuffer);
    QuickSort quickSort = new QuickSort();
    quickSort.sort(sortableObj, 0, memBlock.currentPtr);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.