Interface DataGenerator<T>

All Superinterfaces:
Iterator<T>, Serializable
All Known Implementing Classes:
RandomGenerator, SequenceGenerator

@Experimental public interface DataGenerator<T> extends Serializable, Iterator<T>
Stateful and re-scalable data generator.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    open(String name, org.apache.flink.runtime.state.FunctionInitializationContext context, org.apache.flink.api.common.functions.RuntimeContext runtimeContext)
    Open and initialize state for DataGenerator.
    default void
    snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)
    Snapshot state for DataGenerator.

    Methods inherited from interface java.util.Iterator

    forEachRemaining, hasNext, next, remove
  • Method Details

    • open

      void open(String name, org.apache.flink.runtime.state.FunctionInitializationContext context, org.apache.flink.api.common.functions.RuntimeContext runtimeContext) throws Exception
      Open and initialize state for DataGenerator. See CheckpointedFunction.initializeState(org.apache.flink.runtime.state.FunctionInitializationContext).
      Parameters:
      name - The state of DataGenerator should related to this name, make sure the name of state is different.
      Throws:
      Exception
    • snapshotState

      default void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context) throws Exception
      Snapshot state for DataGenerator. See CheckpointedFunction.snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext).
      Throws:
      Exception