[MINOR] Reuse random object (#1222)
This commit is contained in:
committed by
vinoth chandar
parent
c1f8acab34
commit
fd8f1c70c0
@@ -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() {
|
||||
@@ -228,7 +229,7 @@ public class TestHoodieCompactionStrategy {
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user