Skip to content

Commit cda4cb7

Browse files
committed
make it clear that seed is for testing
1 parent fd09ca1 commit cda4cb7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/SampleOperator.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,21 @@
2828

2929
public class SampleOperator implements Operator {
3030

31-
public record Factory(double probability, Integer seed) implements OperatorFactory {
31+
public static class Factory implements OperatorFactory {
32+
33+
private final double probability;
34+
private final Integer seed;
3235

3336
public Factory(double probability) {
3437
this(probability, null);
3538
}
3639

40+
// visible for testing
41+
Factory(double probability, Integer seed) {
42+
this.probability = probability;
43+
this.seed = seed;
44+
}
45+
3746
@Override
3847
public SampleOperator get(DriverContext driverContext) {
3948
return new SampleOperator(probability, seed == null ? Randomness.get().nextInt() : seed);

0 commit comments

Comments
 (0)