StoreBuilder<WindowStore<K, VR>> materialize(
final MaterializedInternal<K, VR, WindowStore<Bytes, byte[]>> materialized)
TimeWindowedKStreamImpl
TimeWindowedKStreamImpl
is a stream for time-windowed streaming aggregations.
TimeWindowedKStreamImpl
is created exclusively when KGroupedStreamImpl
is requested to windowedBy (with a Windows).
TimeWindowedKStreamImpl
uses a GroupedStreamAggregateBuilder for…FIXME
Creating StoreBuilder (of WindowStores) — materialize
Internal Method
materialize
creates a StoreBuilder
of WindowStores
per MaterializedInternal.
Internally, materialize
requests the given MaterializedInternal
for WindowBytesStoreSupplier.
Unless a WindowBytesStoreSupplier is specified, materialize
…FIXME
materialize
uses the given MaterializedInternal
for retention.
materialize
throws a IllegalArgumentException
when…FIXME
The retention period of the window store [name] must be no smaller than its window size plus the grace period. Got size=[[size]], grace=[[gracePeriodMs]], retention=[[retentionPeriod]]
materialize
uses the Stores
factory object to create a WindowBytesStoreSupplier (with the store name and the retentionPeriod
of the MaterializedInternal
and the window size).
With WindowBytesStoreSupplier
specified, materialize
uses the Stores
factory object to create a StoreBuilder of WindowStores (with the WindowBytesStoreSupplier
and the key and value serdes from the given MaterializedInternal
).
If the given MaterializedInternal
has loggingEnabled flag enabled, materialize
requests the StoreBuilder
to withLoggingEnabled (with the logConfig of the given MaterializedInternal
) or withLoggingDisabled otherwise.
If the given MaterializedInternal
has cachingEnabled flag enabled, materialize
requests the StoreBuilder
to withCachingEnabled.
In the end, materialize
returns the StoreBuilder
of WindowStores
.
Note
|
materialize is used when TimeWindowedKStreamImpl is requested to doCount, aggregate and reduce (when the internal GroupedStreamAggregateBuilder is requested to build).
|
aggregate
Method
KTable<Windowed<K>, VR> aggregate(
final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator)
KTable<Windowed<K>, VR> aggregate(
final Initializer<VR> initializer,
final Aggregator<? super K, ? super V, VR> aggregator,
final Materialized<K, VR, WindowStore<Bytes, byte[]>> materialized)
Note
|
aggregate is part of the TimeWindowedKStream Contract to…FIXME.
|
aggregate
…FIXME
reduce
Method
KTable<Windowed<K>, V> reduce(final Reducer<V> reducer) (1)
KTable<Windowed<K>, V> reduce(
final Reducer<V> reducer,
final Materialized<K, V, WindowStore<Bytes, byte[]>> materialized)
-
Uses Materialized with the serdes for keys and values
Note
|
reduce is part of the TimeWindowedKStream Contract to combine record stream (by a grouped key).
|
reduce
creates a MaterializedInternal for the given Materialized and requests it to generateStoreNameIfNeeded (with KSTREAM-REDUCE-
store prefix).
In the end, reduce
requests the GroupedStreamAggregateBuilder to build (with KSTREAM-REDUCE-
store prefix and a new KStreamWindowReduce
).
count
Method
KTable<Windowed<K>, Long> count()
KTable<Windowed<K>, Long> count(final Materialized<K, Long, WindowStore<Bytes, byte[]>> materialized)
Note
|
count is part of the TimeWindowedKStream Contract to…FIXME.
|
count
…FIXME
doCount
Internal Method
KTable<Windowed<K>, Long> doCount(final Materialized<K, Long, WindowStore<Bytes, byte[]>> materialized)
doCount
…FIXME
Note
|
doCount is used exclusively when TimeWindowedKStreamImpl is requested to count.
|
Creating TimeWindowedKStreamImpl Instance
TimeWindowedKStreamImpl
takes the following when created:
TimeWindowedKStreamImpl
initializes the internal registries and counters.