public final class TradingVolumeOverTime extends Object
The sample Jet pipeline uses a mock data source that generates random trade events. The source also simulates the disorder in the event stream, so some events come on time and some are late by up to five seconds.
The pipeline calculates for each 2-second period the total amount of stocks that changed hands over that period. Since there's disorder in the event stream, the final result for a given time period becomes known only after a five-second delay.
We want to see some results immediately, even if incomplete, so we enable early result emission on Jet's windowing operator. With this change, Jet will keep emitting the current incomplete results as the events are still coming in.
The sample also starts a GUI window that visualizes the progress of early results gradually becoming complete. Each bar in the chart represents a two-second window, so with the disorder of 5 seconds, there are three to four bars rising at any point in time.
|Constructor and Description|
Copyright © 2020 Hazelcast, Inc.. All rights reserved.