Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class TestHoodieCompactionStrategy {

private static final long MB = 1024 * 1024L;
private String[] partitionPaths = {"2017/01/01", "2017/01/02", "2017/01/03"};
private static final Random RANDOM = new Random();

@Test
public void testUnBounded() {
Expand Down Expand Up @@ -228,7 +229,7 @@ public void testUnboundedPartitionAwareCompactionSimple() {
private List<HoodieCompactionOperation> createCompactionOperations(HoodieWriteConfig config,
Map<Long, List<Long>> sizesMap) {
Map<Long, String> keyToPartitionMap = sizesMap.keySet().stream()
.map(e -> Pair.of(e, partitionPaths[new Random().nextInt(partitionPaths.length - 1)]))
.map(e -> Pair.of(e, partitionPaths[RANDOM.nextInt(partitionPaths.length - 1)]))
.collect(Collectors.toMap(Pair::getKey, Pair::getValue));
return createCompactionOperations(config, sizesMap, keyToPartitionMap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
*/
public class TestHoodieDeltaStreamer extends UtilitiesTestBase {

private static final Random RANDOM = new Random();
private static final String PROPS_FILENAME_TEST_SOURCE = "test-source.properties";
private static final String PROPS_FILENAME_TEST_INVALID = "test-invalid.properties";
private static final Logger LOG = LogManager.getLogger(TestHoodieDeltaStreamer.class);
Expand Down Expand Up @@ -634,7 +635,7 @@ public static class DistanceUDF implements UDF4<Double, Double, Double, Double,
*/
@Override
public Double call(Double lat1, Double lat2, Double lon1, Double lon2) {
return new Random().nextDouble();
return RANDOM.nextDouble();
}
}

Expand Down