Skip to content

Commit

Permalink
perform mvn spotless:apply
Browse files Browse the repository at this point in the history
  • Loading branch information
llama90 committed Jun 10, 2024
1 parent 0e7e7d7 commit 8c2b769
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.arrow.algorithm.search;

import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.nio.charset.StandardCharsets;
Expand All @@ -25,6 +24,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Stream;
import org.apache.arrow.algorithm.sort.DefaultVectorComparators;
import org.apache.arrow.algorithm.sort.VectorValueComparator;
import org.apache.arrow.memory.BufferAllocator;
Expand All @@ -36,6 +36,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

/** Test cases for {@link ParallelSearcher}. */
public class TestParallelSearcher {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.stream.Stream;

import org.apache.arrow.algorithm.sort.DefaultVectorComparators;
import org.apache.arrow.algorithm.sort.VectorValueComparator;
import org.apache.arrow.memory.BufferAllocator;
Expand All @@ -30,6 +29,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

/** Test cases for {@link VectorRangeSearcher}. */
public class TestVectorRangeSearcher {

Expand Down Expand Up @@ -181,11 +181,6 @@ public void testGetUpperBoundsNegative(int repeat) {
}

public static Stream<Arguments> getRepeat() {
return Stream.of(
Arguments.of(1),
Arguments.of(2),
Arguments.of(5),
Arguments.of(10)
);
return Stream.of(Arguments.of(1), Arguments.of(2), Arguments.of(5), Arguments.of(10));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

/** Test cases for {@link FixedWidthOutOfPlaceVectorSorter}. */
public class TestFixedWidthOutOfPlaceVectorSorter extends TestOutOfPlaceVectorSorter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.List;
import java.util.function.Function;
import java.util.stream.Stream;

import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.BaseFixedWidthVector;
Expand All @@ -35,6 +34,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

/** Test sorting fixed width vectors with random data. */
public class TestFixedWidthSorting<V extends BaseFixedWidthVector, U extends Comparable<U>> {

Expand Down Expand Up @@ -70,7 +70,10 @@ public void testSort(
}
}

void sortInPlace(int length, double nullFraction, Function<BufferAllocator, V> vectorGenerator,
void sortInPlace(
int length,
double nullFraction,
Function<BufferAllocator, V> vectorGenerator,
TestSortingUtil.DataGenerator<V, U> dataGenerator) {
try (V vector = vectorGenerator.apply(allocator)) {
U[] array = dataGenerator.populate(vector, length, nullFraction);
Expand All @@ -86,7 +89,10 @@ void sortInPlace(int length, double nullFraction, Function<BufferAllocator, V> v
}
}

void sortOutOfPlace(int length, double nullFraction, Function<BufferAllocator, V> vectorGenerator,
void sortOutOfPlace(
int length,
double nullFraction,
Function<BufferAllocator, V> vectorGenerator,
TestSortingUtil.DataGenerator<V, U> dataGenerator) {
try (V vector = vectorGenerator.apply(allocator)) {
U[] array = dataGenerator.populate(vector, length, nullFraction);
Expand Down Expand Up @@ -123,8 +129,7 @@ public static Stream<Arguments> getParameters() {
"TinyIntVector",
(Function<BufferAllocator, TinyIntVector>)
allocator -> new TinyIntVector("vector", allocator),
TestSortingUtil.TINY_INT_GENERATOR
));
TestSortingUtil.TINY_INT_GENERATOR));

params.add(
Arguments.of(
Expand All @@ -134,8 +139,7 @@ public static Stream<Arguments> getParameters() {
"SmallIntVector",
(Function<BufferAllocator, SmallIntVector>)
allocator -> new SmallIntVector("vector", allocator),
TestSortingUtil.SMALL_INT_GENERATOR
));
TestSortingUtil.SMALL_INT_GENERATOR));

params.add(
Arguments.of(
Expand All @@ -145,8 +149,7 @@ public static Stream<Arguments> getParameters() {
"IntVector",
(Function<BufferAllocator, IntVector>)
allocator -> new IntVector("vector", allocator),
TestSortingUtil.INT_GENERATOR
));
TestSortingUtil.INT_GENERATOR));

params.add(
Arguments.of(
Expand All @@ -156,8 +159,7 @@ public static Stream<Arguments> getParameters() {
"BigIntVector",
(Function<BufferAllocator, BigIntVector>)
allocator -> new BigIntVector("vector", allocator),
TestSortingUtil.LONG_GENERATOR
));
TestSortingUtil.LONG_GENERATOR));

params.add(
Arguments.of(
Expand All @@ -167,8 +169,7 @@ public static Stream<Arguments> getParameters() {
"Float4Vector",
(Function<BufferAllocator, Float4Vector>)
allocator -> new Float4Vector("vector", allocator),
TestSortingUtil.FLOAT_GENERATOR
));
TestSortingUtil.FLOAT_GENERATOR));

params.add(
Arguments.of(
Expand All @@ -178,8 +179,7 @@ public static Stream<Arguments> getParameters() {
"Float8Vector",
(Function<BufferAllocator, Float8Vector>)
allocator -> new Float8Vector("vector", allocator),
TestSortingUtil.DOUBLE_GENERATOR
));
TestSortingUtil.DOUBLE_GENERATOR));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.List;
import java.util.stream.Stream;
import org.junit.jupiter.params.provider.Arguments;

/** Test cases for out-of-place sorters. */
public abstract class TestOutOfPlaceVectorSorter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.arrow.vector.VarCharVector;
import org.apache.arrow.vector.testing.RandomDataGenerator;
import org.apache.arrow.vector.testing.ValueVectorDataPopulator;

/** Utilities for sorting related utilities. */
public class TestSortingUtil {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

/** Test cases for {@link VariableWidthOutOfPlaceVectorSorter}. */
public class TestVariableWidthOutOfPlaceVectorSorter extends TestOutOfPlaceVectorSorter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Stream;
import java.util.function.Function;
import java.util.stream.Stream;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.BaseVariableWidthVector;
Expand All @@ -38,6 +38,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

/** Test sorting variable width vectors with random data. */
public class TestVariableWidthSorting<V extends BaseVariableWidthVector, U extends Comparable<U>> {

Expand Down

0 comments on commit 8c2b769

Please sign in to comment.