W
- type of the writer objectT
- type of the items the sink will acceptpublic final class SinkBuilder<W,T> extends Object
Modifier and Type | Method and Description |
---|---|
Sink<T> |
build()
Creates and returns the
Sink with the components you supplied to
this builder. |
SinkBuilder<W,T> |
destroyFn(DistributedConsumer<? super W> destroyFn)
Sets the function that will destroy the writer and perform any cleanup.
|
SinkBuilder<W,T> |
flushFn(DistributedConsumer<? super W> flushFn)
Sets the function that implements the sink's flushing behavior.
|
SinkBuilder<W,T> |
onReceiveFn(DistributedBiConsumer<? super W,? super T> onReceiveFn)
Sets the function Jet will call upon receiving an item.
|
@Nonnull public SinkBuilder<W,T> onReceiveFn(@Nonnull DistributedBiConsumer<? super W,? super T> onReceiveFn)
createFn
and the received item. Its job is to push the item to the
writer.onReceiveFn
- the "add item to the writer" function@Nonnull public SinkBuilder<W,T> flushFn(@Nonnull DistributedConsumer<? super W> flushFn)
You are not required to provide this function in case your implementation doesn't need it.
flushFn
- the optional "flush the writer" function@Nonnull public SinkBuilder<W,T> destroyFn(@Nonnull DistributedConsumer<? super W> destroyFn)
flushFn
and the call to destroyFn
.
You are not required to provide this function in case your implementation doesn't need it.
destroyFn
- the optional "destroy the writer" functionCopyright © 2018 Hazelcast, Inc.. All rights reserved.