Class DataGeneratorSource<T>

java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
org.apache.flink.streaming.api.functions.source.legacy.RichParallelSourceFunction<T>
org.apache.flink.streaming.api.functions.source.datagen.DataGeneratorSource<T>
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction, org.apache.flink.streaming.api.checkpoint.CheckpointedFunction, org.apache.flink.streaming.api.functions.source.legacy.ParallelSourceFunction<T>, org.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>

@Internal public class DataGeneratorSource<T> extends org.apache.flink.streaming.api.functions.source.legacy.RichParallelSourceFunction<T> implements org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
Deprecated.
Use org.apache.flink.connector.datagen.source.DataGeneratorSource instead.
A data generator source that abstract data generator. It can be used to easy startup/test for streaming job and performance testing. It is stateful, re-scalable, possibly in parallel.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.functions.source.legacy.SourceFunction

    org.apache.flink.streaming.api.functions.source.legacy.SourceFunction.SourceContext<T extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Creates a source that emits records by DataGenerator without controlling emit rate.
    DataGeneratorSource(DataGenerator<T> generator, long rowsPerSecond, Long numberOfRows)
    Deprecated.
    Creates a source that emits records by DataGenerator.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated.
     
    void
    Deprecated.
     
    void
    initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context)
    Deprecated.
     
    void
    open(org.apache.flink.api.common.functions.OpenContext openContext)
    Deprecated.
     
    void
    run(org.apache.flink.streaming.api.functions.source.legacy.SourceFunction.SourceContext<T> ctx)
    Deprecated.
     
    void
    snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)
    Deprecated.
     

    Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction

    getIterationRuntimeContext, getRuntimeContext, setRuntimeContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DataGeneratorSource

      public DataGeneratorSource(DataGenerator<T> generator)
      Deprecated.
      Creates a source that emits records by DataGenerator without controlling emit rate.
      Parameters:
      generator - data generator.
    • DataGeneratorSource

      public DataGeneratorSource(DataGenerator<T> generator, long rowsPerSecond, @Nullable Long numberOfRows)
      Deprecated.
      Creates a source that emits records by DataGenerator.
      Parameters:
      generator - data generator.
      rowsPerSecond - Control the emit rate.
      numberOfRows - Total number of rows to output.
  • Method Details

    • open

      public void open(org.apache.flink.api.common.functions.OpenContext openContext) throws Exception
      Deprecated.
      Specified by:
      open in interface org.apache.flink.api.common.functions.RichFunction
      Overrides:
      open in class org.apache.flink.api.common.functions.AbstractRichFunction
      Throws:
      Exception
    • initializeState

      public void initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context) throws Exception
      Deprecated.
      Specified by:
      initializeState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
      Throws:
      Exception
    • snapshotState

      public void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context) throws Exception
      Deprecated.
      Specified by:
      snapshotState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
      Throws:
      Exception
    • run

      public void run(org.apache.flink.streaming.api.functions.source.legacy.SourceFunction.SourceContext<T> ctx) throws Exception
      Deprecated.
      Specified by:
      run in interface org.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>
      Throws:
      Exception
    • close

      public void close() throws Exception
      Deprecated.
      Specified by:
      close in interface org.apache.flink.api.common.functions.RichFunction
      Overrides:
      close in class org.apache.flink.api.common.functions.AbstractRichFunction
      Throws:
      Exception
    • cancel

      public void cancel()
      Deprecated.
      Specified by:
      cancel in interface org.apache.flink.streaming.api.functions.source.legacy.SourceFunction<T>