org.apache.hadoop.util.MergeSort Java Examples

The following examples show how to use org.apache.hadoop.util.MergeSort. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MergeSorter.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/** The sort method derived from BasicTypeSorterBase and overridden here*/
public RawKeyValueIterator sort() {
  MergeSort m = new MergeSort(this);
  int count = super.count;
  if (count == 0) return null;
  int [] pointers = super.pointers;
  int [] pointersCopy = new int[count];
  System.arraycopy(pointers, 0, pointersCopy, 0, count);
  m.mergeSort(pointers, pointersCopy, 0, count);
  return new MRSortResultIterator(super.keyValBuffer, pointersCopy, 
                                  super.startOffsets, super.keyLengths, super.valueLengths);
}
 
Example #2
Source File: MergeSorter.java    From big-c with Apache License 2.0 4 votes vote down vote up
/** The sort method derived from BasicTypeSorterBase and overridden here*/
public RawKeyValueIterator sort() {
  MergeSort m = new MergeSort(this);
  int count = super.count;
  if (count == 0) return null;
  int [] pointers = super.pointers;
  int [] pointersCopy = new int[count];
  System.arraycopy(pointers, 0, pointersCopy, 0, count);
  m.mergeSort(pointers, pointersCopy, 0, count);
  return new MRSortResultIterator(super.keyValBuffer, pointersCopy, 
                                  super.startOffsets, super.keyLengths, super.valueLengths);
}
 
Example #3
Source File: MergeSorter.java    From RDFS with Apache License 2.0 4 votes vote down vote up
/** The sort method derived from BasicTypeSorterBase and overridden here*/
public RawKeyValueIterator sort() {
  MergeSort m = new MergeSort(this);
  int count = super.count;
  if (count == 0) return null;
  int [] pointers = super.pointers;
  int [] pointersCopy = new int[count];
  System.arraycopy(pointers, 0, pointersCopy, 0, count);
  m.mergeSort(pointers, pointersCopy, 0, count);
  return new MRSortResultIterator(super.keyValBuffer, pointersCopy, 
                                  super.startOffsets, super.keyLengths, super.valueLengths);
}
 
Example #4
Source File: MergeSorter.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
/** The sort method derived from BasicTypeSorterBase and overridden here*/
public RawKeyValueIterator sort() {
  MergeSort m = new MergeSort(this);
  int count = super.count;
  if (count == 0) return null;
  int [] pointers = super.pointers;
  int [] pointersCopy = new int[count];
  System.arraycopy(pointers, 0, pointersCopy, 0, count);
  m.mergeSort(pointers, pointersCopy, 0, count);
  return new MRSortResultIterator(super.keyValBuffer, pointersCopy, 
                                  super.startOffsets, super.keyLengths, super.valueLengths);
}