/** * Creates a new sorting thread. * * @param exceptionHandler The exception handler to call for all exceptions. * @param queues The circularQueues used to pass buffers between the threads. */ public SortingThread(ExceptionHandler<IOException> exceptionHandler, CircularQueues queues) { super(exceptionHandler, "SortMerger sorting thread", queues); // members this.sorter = new QuickSort(); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
public void sort(IndexedSortable s) { sort(s, 0, s.size()); }
fix(s, mN, mO, pN, pO); fix(s, mN, mO, rdN, rdO); fix(s, pN, pO, rdN, rdO); sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, i, iN, iO, depth); p = j; pN = jN; pO = jO; } else { sortInternal(s, recordsPerSegment, recordSize, maxOffset, j, jN, jO, r, rN, rO, depth); r = i; rN = iN; rO = iO;
fix(s, mN, mO, pN, pO); fix(s, mN, mO, rdN, rdO); fix(s, pN, pO, rdN, rdO); sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, i, iN, iO, depth); p = j; pN = jN; pO = jO; } else { sortInternal(s, recordsPerSegment, recordSize, maxOffset, j, jN, jO, r, rN, rO, depth); r = i; rN = iN; rO = iO;
public void sort(IndexedSortable s) { sort(s, 0, s.size()); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
fix(s, mN, mO, pN, pO); fix(s, mN, mO, rdN, rdO); fix(s, pN, pO, rdN, rdO); sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, i, iN, iO, depth); p = j; pN = jN; pO = jO; } else { sortInternal(s, recordsPerSegment, recordSize, maxOffset, j, jN, jO, r, rN, rO, depth); r = i; rN = iN; rO = iO;
/** * Creates a new sorting thread. * * @param exceptionHandler The exception handler to call for all exceptions. * @param queues The queues used to pass buffers between the threads. * @param parentTask The task that started this thread. If non-null, it is used to register this thread. */ public SortingThread(ExceptionHandler<IOException> exceptionHandler, CircularQueues<E> queues, AbstractInvokable parentTask) { super(exceptionHandler, "SortMerger sorting thread", queues, parentTask); // members this.sorter = new QuickSort(); }
public void sort(IndexedSortable s) { sort(s, 0, s.size()); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
fix(s, mN, mO, pN, pO); fix(s, mN, mO, rdN, rdO); fix(s, pN, pO, rdN, rdO); sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, i, iN, iO, depth); p = j; pN = jN; pO = jO; } else { sortInternal(s, recordsPerSegment, recordSize, maxOffset, j, jN, jO, r, rN, rO, depth); r = i; rN = iN; rO = iO;
/** * Creates a new sorting thread. * * @param exceptionHandler The exception handler to call for all exceptions. * @param queues The queues used to pass buffers between the threads. * @param parentTask The task that started this thread. If non-null, it is used to register this thread. */ public SortingThread(ExceptionHandler<IOException> exceptionHandler, CircularQueues<E> queues, AbstractInvokable parentTask) { super(exceptionHandler, "SortMerger sorting thread", queues, parentTask); // members this.sorter = new QuickSort(); }
public void sort(IndexedSortable s) { sort(s, 0, s.size()); }
/** * Sort the given range of items using quick sort. {@inheritDoc} If the recursion depth falls below * {@link #getMaxDepth}, then switch to {@link HeapSort}. */ public void sort(final IndexedSortable s, int p, int r) { int recordsPerSegment = s.recordsPerSegment(); int recordSize = s.recordSize(); int maxOffset = recordSize * (recordsPerSegment - 1); int pN = p / recordsPerSegment; int pO = (p % recordsPerSegment) * recordSize; int rN = r / recordsPerSegment; int rO = (r % recordsPerSegment) * recordSize; sortInternal(s, recordsPerSegment, recordSize, maxOffset, p, pN, pO, r, rN, rO, getMaxDepth(r - p)); }
/** * Creates a new sorting thread. * * @param exceptionHandler The exception handler to call for all exceptions. * @param queues The queues used to pass buffers between the threads. * @param parentTask The task that started this thread. If non-null, it is used to register this thread. */ public SortingThread(ExceptionHandler<IOException> exceptionHandler, CircularQueues<E> queues, AbstractInvokable parentTask) { super(exceptionHandler, "SortMerger sorting thread", queues, parentTask); // members this.sorter = new QuickSort(); }
/** * Creates a new sorting thread. * * @param exceptionHandler The exception handler to call for all exceptions. * @param queues The queues used to pass buffers between the threads. * @param parentTask The task that started this thread. If non-null, it is used to register this thread. */ public SortingThread(ExceptionHandler<IOException> exceptionHandler, CircularQueues<E> queues, AbstractInvokable parentTask) { super(exceptionHandler, "SortMerger sorting thread", queues, parentTask); // members this.sorter = new QuickSort(); }
this.comparator = comparator; this.pageSize = pageSize; this.sorter = new QuickSort(); this.maxNumFileHandles = conf.getInteger(TableConfigOptions.SQL_EXEC_SORT_FILE_HANDLES_MAX_NUM); this.compressionEnable = conf.getBoolean(TableConfigOptions.SQL_EXEC_SPILL_COMPRESSION_ENABLED);