@Experimental public abstract class RandomGenerator<T> extends Object implements DataGenerator<T>
| Modifier and Type | Field and Description |
|---|---|
protected float |
nullRate |
protected org.apache.commons.math3.random.RandomDataGenerator |
random |
protected boolean |
varLen |
| Constructor and Description |
|---|
RandomGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static <T> RandomGenerator<T[]> |
arrayGenerator(DataGenerator<T> generator,
int len) |
static RandomGenerator<Boolean> |
booleanGenerator() |
static RandomGenerator<Byte> |
byteGenerator(byte min,
byte max) |
static RandomGenerator<Double> |
doubleGenerator(double min,
double max) |
static RandomGenerator<Float> |
floatGenerator(float min,
float max) |
boolean |
hasNext() |
static RandomGenerator<Integer> |
intGenerator(int min,
int max) |
static RandomGenerator<Long> |
longGenerator(long min,
long max) |
static <K,V> RandomGenerator<Map<K,V>> |
mapGenerator(DataGenerator<K> key,
DataGenerator<V> value,
int size) |
protected T |
nextWithNullRate(java.util.function.Supplier<T> supplier) |
void |
open(String name,
org.apache.flink.runtime.state.FunctionInitializationContext context,
org.apache.flink.api.common.functions.RuntimeContext runtimeContext)
Open and initialize state for
DataGenerator. |
static RandomGenerator<Short> |
shortGenerator(short min,
short max) |
static RandomGenerator<String> |
stringGenerator(int len) |
RandomGenerator<T> |
withNullRate(float nullRate) |
RandomGenerator<T> |
withVarLen(boolean varLen) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsnapshotStateforEachRemaining, next, removeprotected transient org.apache.commons.math3.random.RandomDataGenerator random
protected float nullRate
protected boolean varLen
public void open(String name, org.apache.flink.runtime.state.FunctionInitializationContext context, org.apache.flink.api.common.functions.RuntimeContext runtimeContext) throws Exception
DataGeneratorDataGenerator. See CheckpointedFunction.initializeState(org.apache.flink.runtime.state.FunctionInitializationContext).open in interface DataGenerator<T>name - The state of DataGenerator should related to this name, make sure the
name of state is different.Exceptionpublic RandomGenerator<T> withNullRate(float nullRate)
protected T nextWithNullRate(java.util.function.Supplier<T> supplier)
public RandomGenerator<T> withVarLen(boolean varLen)
public static RandomGenerator<Long> longGenerator(long min, long max)
public static RandomGenerator<Integer> intGenerator(int min, int max)
public static RandomGenerator<Short> shortGenerator(short min, short max)
public static RandomGenerator<Byte> byteGenerator(byte min, byte max)
public static RandomGenerator<Float> floatGenerator(float min, float max)
public static RandomGenerator<Double> doubleGenerator(double min, double max)
public static RandomGenerator<String> stringGenerator(int len)
public static RandomGenerator<Boolean> booleanGenerator()
public static <T> RandomGenerator<T[]> arrayGenerator(DataGenerator<T> generator, int len)
public static <K,V> RandomGenerator<Map<K,V>> mapGenerator(DataGenerator<K> key, DataGenerator<V> value, int size)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.