public abstract class RowGenerator
extends org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction<org.apache.flink.types.Row>
In order to reduce the impact of source function overhead on the benchmark execution time, this class will pre-generate 1/1000 of the expected number of output values and re-use these values as the source function output.
Modifier and Type | Field and Description |
---|---|
protected Random |
random
Random instance to generate data.
|
Constructor and Description |
---|
RowGenerator(long numValues,
long initSeed) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
protected abstract org.apache.flink.types.Row |
getRow()
Generates a new data point.
|
protected abstract org.apache.flink.api.java.typeutils.RowTypeInfo |
getRowTypeInfo()
Returns the output type information for this generator.
|
void |
open(org.apache.flink.configuration.Configuration parameters) |
void |
run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.flink.types.Row> ctx) |
protected Random random
public final void open(org.apache.flink.configuration.Configuration parameters) throws Exception
open
in interface org.apache.flink.api.common.functions.RichFunction
open
in class org.apache.flink.api.common.functions.AbstractRichFunction
Exception
public final void run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.flink.types.Row> ctx)
public final void cancel()
protected abstract org.apache.flink.types.Row getRow()
protected abstract org.apache.flink.api.java.typeutils.RowTypeInfo getRowTypeInfo()
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.