Interface DupCompactKernel

All Known Implementing Classes:
ByteDupCompactKernel, ByteReverseDupCompactKernel, CharDupCompactKernel, CharReverseDupCompactKernel, DoubleDupCompactKernel, DoubleReverseDupCompactKernel, EqualsConsistentObjectDupCompactKernel, EqualsConsistentObjectReverseDupCompactKernel, FloatDupCompactKernel, FloatReverseDupCompactKernel, IntDupCompactKernel, IntReverseDupCompactKernel, LongDupCompactKernel, LongReverseDupCompactKernel, ObjectDupCompactKernel, ObjectReverseDupCompactKernel, ShortDupCompactKernel, ShortReverseDupCompactKernel

public interface DupCompactKernel
  • Method Details

    • makeDupCompactDeephavenOrdering

      static DupCompactKernel makeDupCompactDeephavenOrdering(@NotNull @NotNull ChunkType chunkType, boolean equalsConsistent, boolean reverse)
      Make a DupCompactKernel that orders values as Deephaven sorts them.
      Parameters:
      chunkType - the chunk type of the values
      equalsConsistent - true when values of the data type compare equal exactly when they are equal (see BinarySearchKernelHelper.compareConsistentWithEquality(Class)), which selects the EqualsConsistentObject kernel that tests Object equality with equals; when false, Object equality is tested with ObjectComparisons.compareEquals(Object, Object). Other chunk types ignore it. An operation reads the registry once and passes the same decision to every kernel it creates, so its kernels come from one family.
      reverse - true for descending values
      Returns:
      the DupCompactKernel
    • makeDupCompactNaturalOrdering

      static DupCompactKernel makeDupCompactNaturalOrdering(@NotNull @NotNull ChunkType chunkType, boolean equalsConsistent, boolean reverse)
      Make a DupCompactKernel that orders values by their natural ordering.
      Parameters:
      chunkType - the chunk type of the values
      equalsConsistent - true when values of the data type compare equal exactly when they are equal (see BinarySearchKernelHelper.compareConsistentWithEquality(Class)), which selects the EqualsConsistentObject kernel that tests Object equality with equals; when false, Object equality is tested with ObjectComparisons.compareEquals(Object, Object). Other chunk types ignore it. An operation reads the registry once and passes the same decision to every kernel it creates, so its kernels come from one family.
      reverse - true for descending values
      Returns:
      the DupCompactKernel
    • compactDuplicates

      int compactDuplicates(@NotNull @NotNull WritableChunk<? extends Any> chunkToCompact, @NotNull @NotNull WritableLongChunk<RowKeys> rowKeys)
      Remove all adjacent values from chunkToCompact, except the last value in any adjacent run. The rowKeys are parallel to the chunkToCompact. When a value is removed from chunkToCompact, it is also removed from rowKeys.

      Additionally, verifies that the elements in chunkToCompact are properly ordered. Upon encountering an out-of-order element, the operation stops compacting and returns the position of the out-of-order element.

      Parameters:
      chunkToCompact - The values to remove duplicates from
      rowKeys - The row keys parallel to chunkToCompact
      Returns:
      The first position of an out-of-order element, or -1 if all elements are in order
    • compactDuplicatesPreferFirst

      int compactDuplicatesPreferFirst(@NotNull @NotNull WritableChunk<? extends Any> chunkToCompact, @NotNull @NotNull WritableIntChunk<ChunkPositions> chunkPositions)
      Remove all adjacent values from chunkToCompact, except the first value in any adjacent run. The chunkPositions are parallel to the chunkToCompact. When a value is removed from chunkToCompact, it is also removed from chunkPositions.

      Additionally, verifies that the elements in chunkToCompact are properly ordered. Upon encountering an out-of-order element, the operation stops compacting and returns the position of the out-of-order element.

      Parameters:
      chunkToCompact - The values to remove duplicates from
      chunkPositions - The chunk positions parallel to chunkToCompact
      Returns:
      The first position of an out-of-order element, or -1 if all elements are in order