Class CarGeneratorFunction
- java.lang.Object
-
- org.apache.flink.streaming.examples.windowing.util.CarGeneratorFunction
-
- All Implemented Interfaces:
Serializable
,Function
,GeneratorFunction<Long,Tuple4<Integer,Integer,Double,Long>>
public class CarGeneratorFunction extends Object implements GeneratorFunction<Long,Tuple4<Integer,Integer,Double,Long>>
A generator function for simulating car data.This generator function generates a stream of car data in a form of a four-element tuple. The data includes the car's ID, its speed in kilometers per hour, the distance it has traveled in meters, and the timestamp of the data generation. The speed and distance of each car are randomly updated in each invocation of the
map(Long)
method.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CarGeneratorFunction(int numOfCars)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tuple4<Integer,Integer,Double,Long>
map(Long ignoredIndex)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.connector.datagen.source.GeneratorFunction
close, open
-
-