public class LoadGeneratorSource
extends java.lang.Object
implements org.apache.flink.streaming.api.functions.source.SourceFunction<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>>
| Modifier and Type | Field and Description |
|---|---|
private int |
backpressureCounter |
private int |
currentGapIndex |
private java.util.List<org.apache.flink.api.java.tuple.Tuple2<java.lang.Long,java.lang.Long>> |
gaps |
private static org.slf4j.Logger |
LOG |
private static int |
maxBackpressure |
private long |
nextGapEnd |
private long |
nextGapStart |
private java.util.Random |
random |
private boolean |
running |
private long |
runtime |
private int |
throughput |
private long |
timeOffset |
| Constructor and Description |
|---|
LoadGeneratorSource(long runtime,
int throughput,
java.util.List<org.apache.flink.api.java.tuple.Tuple2<java.lang.Long,java.lang.Long>> gaps) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
private void |
emitValue(org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long> tuple3,
org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>> ctx) |
private org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long> |
readNextTuple() |
void |
run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>> ctx) |
private static int maxBackpressure
private final long runtime
private static final org.slf4j.Logger LOG
private final int throughput
private boolean running
private final java.util.List<org.apache.flink.api.java.tuple.Tuple2<java.lang.Long,java.lang.Long>> gaps
private int currentGapIndex
private long nextGapStart
private long nextGapEnd
private long timeOffset
private java.util.Random random
private int backpressureCounter
public LoadGeneratorSource(long runtime,
int throughput,
java.util.List<org.apache.flink.api.java.tuple.Tuple2<java.lang.Long,java.lang.Long>> gaps)
public void run(org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>> ctx)
throws java.lang.Exception
run in interface org.apache.flink.streaming.api.functions.source.SourceFunction<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>>java.lang.Exceptionprivate void emitValue(org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long> tuple3,
org.apache.flink.streaming.api.functions.source.SourceFunction.SourceContext<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>> ctx)
private org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long> readNextTuple()
throws java.lang.Exception
java.lang.Exceptionpublic void cancel()
cancel in interface org.apache.flink.streaming.api.functions.source.SourceFunction<org.apache.flink.api.java.tuple.Tuple4<java.lang.String,java.lang.Integer,java.lang.Long,java.lang.Long>>