Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.QuickSort


      }
    }
  }

  public void sort() {
    QuickSort quickSort = new QuickSort();
    quickSort.sort(this, 0, size());
  }
View Full Code Here


    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

  }

  @Override
  protected RecordIterator doWork() {
    StackedComparator r = new StackedComparator(defs);
    QuickSort qs = new QuickSort();
    qs.sort(r, 0, records.size());
    return new OrderIterator();
  }
View Full Code Here

    doSetup(context, hyperBatch, null);
  }
 
  @Override
  public void sort(SelectionVector4 vector4, VectorContainer container){
    QuickSort qs = new QuickSort();
    qs.sort(this, 0, vector4.getTotalCount());
  }
View Full Code Here

      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

    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

 
  @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

    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

    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

      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

TOP

Related Classes of org.apache.hadoop.util.QuickSort

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.