T
- public final class SourceBuilder.TimestampedStream<T> extends Object
Modifier and Type | Method and Description |
---|---|
SourceBuilder.TimestampedStream<T> |
allowedLateness(long allowedLateness)
Sets the limit on the amount of disorder (skew) present in the
timestamps of the events this source will emit.
|
StreamSource<T> |
build()
Builds and returns the timestamped stream source.
|
SourceBuilder.TimestampedStream<T> |
destroyFn(DistributedConsumer<? super S> pDestroyFn)
Sets the function that Jet will call when cleaning up after a job has
ended.
|
SourceBuilder.TimestampedStream<T> |
distributed(int preferredLocalParallelism)
Declares that you're creating a distributed source.
|
<T_NEW> SourceBuilder.TimestampedStream<T_NEW> |
fillBufferFn(DistributedBiConsumer<? super S,? super SourceBuilder.TimestampedSourceBuffer<T_NEW>> fillBufferFn)
Sets the function that Jet will call whenever it needs more data from
your source.
|
@Nonnull public <T_NEW> SourceBuilder.TimestampedStream<T_NEW> fillBufferFn(@Nonnull DistributedBiConsumer<? super S,? super SourceBuilder.TimestampedSourceBuffer<T_NEW>> fillBufferFn)
createFn
and Jet's buffer object. It should add some items
to the buffer, ideally those it can produce without making any blocking
calls. The buffer's add()
method takes two arguments: the item and the timestamp in milliseconds.
On any given invocation the function may also choose not to add any items. Jet will automatically employ an exponential backoff strategy to avoid calling your function in a tight loop during a period when there's no data ready to be emitted.
T_NEW
- type of the emitted itemsfillBufferFn
- function that fills the buffer with source datafillBufferFn
@Nonnull public SourceBuilder.TimestampedStream<T> destroyFn(@Nonnull DistributedConsumer<? super S> pDestroyFn)
@Nonnull public SourceBuilder.TimestampedStream<T> distributed(int preferredLocalParallelism)
preferredLocalParallelism
parameter. If you call this, you must
ensure that all the source processors are coordinated and not emitting
duplicated data. The createFn
can consult procContext.totalParallelism()
and procContext.globalProcessorIndex()
. Jet calls createFn
exactly
once with each globalProcessorIndex
from 0 to totalParallelism - 1
, this can help all the instances agree on which
part of the data to emit.preferredLocalParallelism
- requested number of processors on each cluster member@Nonnull public SourceBuilder.TimestampedStream<T> allowedLateness(long allowedLateness)
allowedLateness
- limit on how much the timestamp of an event being emitted can lag behind
the highest emitted timestamp so far@Nonnull public StreamSource<T> build()
Copyright © 2018 Hazelcast, Inc.. All rights reserved.