Package com.illumon.iris.db.v2.sort
Interface IntSortKernel<ATTR extends Attributes.Any,KEY_INDICES extends Attributes.Keys>
- All Superinterfaces:
AutoCloseable
,Context
,SafeCloseable
- All Known Implementing Classes:
ByteIntTimsortDescendingKernel.ByteIntSortKernelContext
,ByteIntTimsortKernel.ByteIntSortKernelContext
,CharIntTimsortKernel.CharIntSortKernelContext
,DoubleIntTimsortDescendingKernel.DoubleIntSortKernelContext
,DoubleIntTimsortKernel.DoubleIntSortKernelContext
,FloatIntTimsortDescendingKernel.FloatIntSortKernelContext
,FloatIntTimsortKernel.FloatIntSortKernelContext
,IntIntTimsortDescendingKernel.IntIntSortKernelContext
,IntIntTimsortKernel.IntIntSortKernelContext
,LongIntTimsortDescendingKernel.LongIntSortKernelContext
,LongIntTimsortKernel.LongIntSortKernelContext
,NullAwareCharIntTimsortDescendingKernel.CharIntSortKernelContext
,NullAwareCharIntTimsortKernel.CharIntSortKernelContext
,ObjectIntTimsortDescendingKernel.ObjectIntSortKernelContext
,ObjectIntTimsortKernel.ObjectIntSortKernelContext
,ShortIntTimsortDescendingKernel.ShortIntSortKernelContext
,ShortIntTimsortKernel.ShortIntSortKernelContext
public interface IntSortKernel<ATTR extends Attributes.Any,KEY_INDICES extends Attributes.Keys> extends Context
The SortKernel sorts a chunk of primitive value together with a parallel IntChunk of KeyIndices.
-
Method Summary
Modifier and Type Method Description static <ATTR extends Attributes.Any, KEY_INDICES extends Attributes.Keys>
IntSortKernel<ATTR,KEY_INDICES>makeContext(ChunkType chunkType, SortingOrder order, int size, boolean preserveValues)
Creates a SortKernel for the given chunkType.void
sort(WritableIntChunk<KEY_INDICES> indexKeys, WritableChunk<ATTR> valuesToSort)
Sort the values in valuesToSort permuting the indexKeys chunk in the same way.void
sort(WritableIntChunk<KEY_INDICES> indexKeys, WritableChunk<ATTR> valuesToSort, IntChunk<? extends Attributes.ChunkPositions> offsetsIn, IntChunk<? extends Attributes.ChunkLengths> lengthsIn)
Sort the values in valuesToSort permuting the indexKeys chunk in the same way.
-
Method Details
-
makeContext
static <ATTR extends Attributes.Any, KEY_INDICES extends Attributes.Keys> IntSortKernel<ATTR,KEY_INDICES> makeContext(ChunkType chunkType, SortingOrder order, int size, boolean preserveValues)Creates a SortKernel for the given chunkType.- Parameters:
chunkType
- the type of chunk we are sortingorder
- whether we should sort in an ascending or descending directionsize
- how many values we will be sortingpreserveValues
- if the output chunk of our sort should contain the values in sorted order; otherwise the kernel need only permute the input indices into sorted order- Returns:
- a SortKernel suitable for the given type, order, and size
-
sort
Sort the values in valuesToSort permuting the indexKeys chunk in the same way. -
sort
void sort(WritableIntChunk<KEY_INDICES> indexKeys, WritableChunk<ATTR> valuesToSort, IntChunk<? extends Attributes.ChunkPositions> offsetsIn, IntChunk<? extends Attributes.ChunkLengths> lengthsIn)Sort the values in valuesToSort permuting the indexKeys chunk in the same way. The offsetsIn chunk is contains the offset of runs to sort in indexKeys; and the lengthsIn contains the length of the runs. This allows the kernel to be used for a secondary column sort, chaining it together with smaller runs sorted on each pass.
-