T
- Type of the input elements.O
- Type of the returned elements.@Experimental public interface GeneratorFunction<T,O> extends Function
DataGeneratorSource
that
drives the data generation process by supplying "index" values of type Long. It makes it possible
to produce specific elements at concrete positions of the generated data stream.
Example:
GeneratorFunction<Long, String> generatorFunction = index -> "Number: " + index;
DataGeneratorSource<String> source =
new DataGeneratorSource<>(generatorFunction, 1000, Types.STRING);
Modifier and Type | Method and Description |
---|---|
default void |
close()
Tear-down method for the function.
|
O |
map(T value) |
default void |
open(SourceReaderContext readerContext)
Initialization method for the function.
|
default void open(SourceReaderContext readerContext) throws Exception
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.