Generate¶
The generate source will generate new events at a prescribed rate.
RateLimitedGeneratorSourceConfigBuilder.<String>builder()
.withTps(1000.0)
.withGenerator(index -> "event")
.withEventsPerBatch(100)
.withMaxEventCount(10000);
source:
generate:
tps: 1000
eventsPerBatch: 100
maxEventCount: 10000
generator: |
function process(input) {
return "Hello World " + input + "\n";
}
Java dependency management¶
Add this declaration to your dependency management system to access the configuration DSL for this plugin in Java.
<dependency>
<groupId>org.voltdb</groupId>
<artifactId>volt-stream-connectors-api</artifactId>
<version>1.7.0</version>
</dependency>
implementation group: 'org.voltdb', name: 'volt-stream-connectors-api', version: '1.7.0'
Properties¶
tps¶
The rate limit in transactions per second Required.
Type: number
generator¶
A Supplier that produces each data item Required.
Type: object
eventsPerBatch¶
Number of events to generate per batch
Type: number
Default value: 1000
maxEventCount¶
Maximum number of events to generate, default is '0' which means unlimited
Type: number
Default value: 0
JSON Schema¶
You can validate or explore the configuration using its JSON Schema.
Usage Examples¶
stream .consumeFromSource(Sources.generateAtRate(1000, () -> "event") .withEventsPerBatch(100) .build()) .terminateWithSink(Sinks.stdout());