Class SequenceGenerator<T>

    • Field Detail

      • valuesToEmit

        protected transient Deque<Long> valuesToEmit
    • Constructor Detail

      • SequenceGenerator

        public SequenceGenerator​(long start,
                                 long end)
        Creates a DataGenerator that emits all numbers from the given interval exactly once.
        Parameters:
        start - Start of the range of numbers to emit.
        end - End of the range of numbers to emit.
    • Method Detail

      • open

        public void open​(String name,
                         org.apache.flink.runtime.state.FunctionInitializationContext context,
                         org.apache.flink.api.common.functions.RuntimeContext runtimeContext)
                  throws Exception
        Description copied from interface: DataGenerator
        Open and initialize state for DataGenerator. See CheckpointedFunction.initializeState(org.apache.flink.runtime.state.FunctionInitializationContext).
        Specified by:
        open in interface DataGenerator<T>
        Parameters:
        name - The state of DataGenerator should related to this name, make sure the name of state is different.
        Throws:
        Exception
      • snapshotState

        public void snapshotState​(org.apache.flink.runtime.state.FunctionSnapshotContext context)
                           throws Exception
        Description copied from interface: DataGenerator
        Snapshot state for DataGenerator. See CheckpointedFunction.snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext).
        Specified by:
        snapshotState in interface DataGenerator<T>
        Throws:
        Exception
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<T>
      • bigDecimalGenerator

        public static SequenceGenerator<BigDecimal> bigDecimalGenerator​(int start,
                                                                        int end,
                                                                        int precision,
                                                                        int scale)