public void addAll(TypedHeap other) { for (int i = 0; i < other.positionCount; i++) { add(other.heapBlockBuilder, other.heapIndex[i]); } }
public void addAll(Block block) { for (int i = 0; i < block.getPositionCount(); i++) { add(block, i); } }
public static void input(BlockComparator comparator, Type type, MinMaxNState state, Block block, long n, int blockIndex) { TypedHeap heap = state.getTypedHeap(); if (heap == null) { if (n <= 0) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "second argument of max_n/min_n must be positive"); } checkCondition(n <= MAX_NUMBER_OF_VALUES, INVALID_FUNCTION_ARGUMENT, "second argument of max_n/min_n must be less than or equal to %s; found %s", MAX_NUMBER_OF_VALUES, n); heap = new TypedHeap(comparator, type, toIntExact(n)); state.setTypedHeap(heap); } long startSize = heap.getEstimatedSize(); heap.add(block, blockIndex); state.addMemoryUsage(heap.getEstimatedSize() - startSize); }
public void addAll(TypedHeap other) { for (int i = 0; i < other.positionCount; i++) { add(other.heapBlockBuilder, other.heapIndex[i]); } }
public void addAll(Block block) { for (int i = 0; i < block.getPositionCount(); i++) { add(block, i); } }
public static void input(BlockComparator comparator, Type type, MinMaxNState state, Block block, long n, int blockIndex) { TypedHeap heap = state.getTypedHeap(); if (heap == null) { if (n <= 0) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "second argument of max_n/min_n must be positive"); } heap = new TypedHeap(comparator, type, Ints.checkedCast(n)); state.setTypedHeap(heap); } long startSize = heap.getEstimatedSize(); heap.add(block, blockIndex); state.addMemoryUsage(heap.getEstimatedSize() - startSize); }