Package com.illumon.iris.db.v2.sort
Interface ByteSortKernel<ATTR extends Attributes.Any,KEY_INDICES extends Attributes.Keys>
- All Superinterfaces:
AutoCloseable
,Context
,SafeCloseable
- All Known Implementing Classes:
ByteByteTimsortDescendingKernel.ByteByteSortKernelContext
,ByteByteTimsortKernel.ByteByteSortKernelContext
,CharByteTimsortKernel.CharByteSortKernelContext
,DoubleByteTimsortDescendingKernel.DoubleByteSortKernelContext
,DoubleByteTimsortKernel.DoubleByteSortKernelContext
,FloatByteTimsortDescendingKernel.FloatByteSortKernelContext
,FloatByteTimsortKernel.FloatByteSortKernelContext
,IntByteTimsortDescendingKernel.IntByteSortKernelContext
,IntByteTimsortKernel.IntByteSortKernelContext
,LongByteTimsortDescendingKernel.LongByteSortKernelContext
,LongByteTimsortKernel.LongByteSortKernelContext
,NullAwareCharByteTimsortDescendingKernel.CharByteSortKernelContext
,NullAwareCharByteTimsortKernel.CharByteSortKernelContext
,ObjectByteTimsortDescendingKernel.ObjectByteSortKernelContext
,ObjectByteTimsortKernel.ObjectByteSortKernelContext
,ShortByteTimsortDescendingKernel.ShortByteSortKernelContext
,ShortByteTimsortKernel.ShortByteSortKernelContext
public interface ByteSortKernel<ATTR extends Attributes.Any,KEY_INDICES extends Attributes.Keys> extends Context
The SortKernel sorts a chunk of primitive value together with a parallel ByteChunk of KeyIndices.
-
Method Summary
Modifier and Type Method Description static <ATTR extends Attributes.Any, KEY_INDICES extends Attributes.Keys>
ByteSortKernel<ATTR,KEY_INDICES>makeContext(ChunkType chunkType, SortingOrder order, int size, boolean preserveValues)
Creates a SortKernel for the given chunkType.void
sort(WritableByteChunk<KEY_INDICES> indexKeys, WritableChunk<ATTR> valuesToSort)
Sort the values in valuesToSort permuting the indexKeys chunk in the same way.void
sort(WritableByteChunk<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> ByteSortKernel<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(WritableByteChunk<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.
-