@Experimental public abstract class SequenceGenerator<T> extends Object implements DataGenerator<T>
DataGenerator
that emits each number from a given interval
exactly once, possibly in parallel.Modifier and Type | Field and Description |
---|---|
protected Deque<Long> |
valuesToEmit |
Constructor and Description |
---|
SequenceGenerator(long start,
long end)
Creates a DataGenerator that emits all numbers from the given interval exactly once.
|
Modifier and Type | Method and Description |
---|---|
static SequenceGenerator<BigDecimal> |
bigDecimalGenerator(int start,
int end,
int precision,
int scale) |
static SequenceGenerator<Byte> |
byteGenerator(byte start,
byte end) |
static SequenceGenerator<Double> |
doubleGenerator(int start,
int end) |
static SequenceGenerator<Float> |
floatGenerator(short start,
short end) |
boolean |
hasNext() |
static SequenceGenerator<Integer> |
intGenerator(int start,
int end) |
static SequenceGenerator<Long> |
longGenerator(long start,
long end) |
void |
open(String name,
FunctionInitializationContext context,
RuntimeContext runtimeContext)
Open and initialize state for
DataGenerator . |
static SequenceGenerator<Short> |
shortGenerator(short start,
short end) |
void |
snapshotState(FunctionSnapshotContext context)
Snapshot state for
DataGenerator . |
static SequenceGenerator<String> |
stringGenerator(long start,
long end) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, next, remove
public SequenceGenerator(long start, long end)
start
- Start of the range of numbers to emit.end
- End of the range of numbers to emit.public void open(String name, FunctionInitializationContext context, RuntimeContext runtimeContext) throws Exception
DataGenerator
DataGenerator
. 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.Exception
public void snapshotState(FunctionSnapshotContext context) throws Exception
DataGenerator
DataGenerator
. See CheckpointedFunction.snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext)
.snapshotState
in interface DataGenerator<T>
Exception
public static SequenceGenerator<Long> longGenerator(long start, long end)
public static SequenceGenerator<Integer> intGenerator(int start, int end)
public static SequenceGenerator<Short> shortGenerator(short start, short end)
public static SequenceGenerator<Byte> byteGenerator(byte start, byte end)
public static SequenceGenerator<Float> floatGenerator(short start, short end)
public static SequenceGenerator<Double> doubleGenerator(int start, int end)
public static SequenceGenerator<BigDecimal> bigDecimalGenerator(int start, int end, int precision, int scale)
public static SequenceGenerator<String> stringGenerator(long start, long end)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.