Class CarGeneratorFunction

java.lang.Object
org.apache.flink.streaming.examples.windowing.util.CarGeneratorFunction
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.connector.datagen.source.GeneratorFunction<Long,org.apache.flink.api.java.tuple.Tuple4<Integer,Integer,Double,Long>>

public class CarGeneratorFunction extends Object implements org.apache.flink.connector.datagen.source.GeneratorFunction<Long,org.apache.flink.api.java.tuple.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:
  • Constructor Details

    • CarGeneratorFunction

      public CarGeneratorFunction(int numOfCars)
  • Method Details