Package com.hazelcast.jet.core.processor
Class SinkProcessors
java.lang.Object
com.hazelcast.jet.core.processor.SinkProcessors
Static utility class with factories of sink processors (the terminators
of the DAG data flow). For other kinds of processors refer to the
package-level documentation
.- Since:
- Jet 3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
K, V> ProcessorMetaSupplier mergeMapP
(String mapName, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends V> toValueFn, BinaryOperatorEx<V> mergeFn) Returns a supplier of processors forSinks.mapWithMerging(String, FunctionEx, FunctionEx, BinaryOperatorEx)
.static <T,
K, V> ProcessorMetaSupplier mergeRemoteMapP
(String mapName, ClientConfig clientConfig, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends V> toValueFn, BinaryOperatorEx<V> mergeFn) Returns a supplier of processors forSinks.remoteMapWithMerging(String, ClientConfig, FunctionEx, FunctionEx, BinaryOperatorEx)
.static <T,
K, V, R> ProcessorMetaSupplier updateMapP
(int maxParallelAsyncOps, String mapName, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends EntryProcessor<K, V, R>> toEntryProcessorFn) Returns a supplier of processors forSinks.mapWithEntryProcessor(int, String, FunctionEx, FunctionEx)
.static <T,
K, V> ProcessorMetaSupplier updateMapP
(com.hazelcast.jet.impl.connector.MapSinkConfiguration<T, K, V> configuration) static <T,
K, V> ProcessorMetaSupplier updateMapP
(String mapName, FunctionEx<? super T, ? extends K> toKeyFn, BiFunctionEx<? super V, ? super T, ? extends V> updateFn) Returns a supplier of processors forSinks.mapWithEntryProcessor(String, FunctionEx, FunctionEx)
.static <T,
K, V, R> ProcessorMetaSupplier updateMapP
(String mapName, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends EntryProcessor<K, V, R>> toEntryProcessorFn) Returns a supplier of processors forSinks.mapWithEntryProcessor(String, FunctionEx, FunctionEx)
.static <T,
K, V> ProcessorMetaSupplier updateRemoteMapP
(String mapName, ClientConfig clientConfig, FunctionEx<? super T, ? extends K> toKeyFn, BiFunctionEx<? super V, ? super T, ? extends V> updateFn) Returns a supplier of processors forSinks.remoteMapWithUpdating(String, ClientConfig, FunctionEx, BiFunctionEx)
.static <T,
K, V, R> ProcessorMetaSupplier updateRemoteMapP
(String mapName, ClientConfig clientConfig, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends EntryProcessor<K, V, R>> toEntryProcessorFn) Returns a supplier of processors forSinks.remoteMapWithEntryProcessor(String, ClientConfig, FunctionEx, FunctionEx)
.static <W,
T> SupplierEx<Processor> writeBufferedP
(FunctionEx<? super Processor.Context, ? extends W> createFn, BiConsumerEx<? super W, ? super T> onReceiveFn, ConsumerEx<? super W> flushFn) Shortcut forwriteBufferedP(FunctionEx, BiConsumerEx, ConsumerEx, ConsumerEx)
with a no-opdestroyFn
.static <W,
T> SupplierEx<Processor> writeBufferedP
(FunctionEx<? super Processor.Context, ? extends W> createFn, BiConsumerEx<? super W, ? super T> onReceiveFn, ConsumerEx<? super W> flushFn, ConsumerEx<? super W> destroyFn) Returns a supplier of processors for a vertex that drains all the items from the inbox to an internal writer object and then does a flush.static ProcessorMetaSupplier
writeCacheP
(String cacheName) Returns a supplier of processors forSinks.cache(String)
.static <T> ProcessorMetaSupplier
writeFileP
(String directoryName, Charset charset, String datePattern, long maxFileSize, boolean exactlyOnce, FunctionEx<? super T, ? extends String> toStringFn) Returns a supplier of processors forSinks.filesBuilder(java.lang.String)
.static <T> ProcessorMetaSupplier
writeJdbcP
(String updateQuery, DataConnectionRef dataConnectionRef, BiConsumerEx<? super PreparedStatement, ? super T> bindFn, boolean exactlyOnce, int batchLimit) Returns a supplier of processors forSinks.jdbcBuilder()
.static <T> ProcessorMetaSupplier
writeJdbcP
(String jdbcUrl, String updateQuery, SupplierEx<? extends CommonDataSource> dataSourceSupplier, BiConsumerEx<? super PreparedStatement, ? super T> bindFn, boolean exactlyOnce, int batchLimit) Returns a supplier of processors forSinks.jdbcBuilder()
.static <T> ProcessorMetaSupplier
writeJmsQueueP
(String queueName, boolean exactlyOnce, SupplierEx<? extends jakarta.jms.Connection> newConnectionFn, BiFunctionEx<? super jakarta.jms.Session, ? super T, ? extends jakarta.jms.Message> messageFn) Returns a supplier of processors forSinks.jmsQueueBuilder(com.hazelcast.function.SupplierEx<jakarta.jms.ConnectionFactory>)
.static <T> ProcessorMetaSupplier
writeJmsTopicP
(String topicName, boolean exactlyOnce, SupplierEx<? extends jakarta.jms.Connection> newConnectionFn, BiFunctionEx<? super jakarta.jms.Session, ? super T, ? extends jakarta.jms.Message> messageFn) Returns a supplier of processors forSinks.jmsTopicBuilder(com.hazelcast.function.SupplierEx<jakarta.jms.ConnectionFactory>)
.static ProcessorMetaSupplier
writeListP
(String listName) Returns a supplier of processors forSinks.list(String)
.static <T,
K, V> ProcessorMetaSupplier writeMapP
(com.hazelcast.jet.impl.connector.MapSinkConfiguration<T, K, V> configuration) Returns a supplier of processorsstatic <K,
V> ProcessorMetaSupplier Returns a supplier of processors forSinks.map(String)
.static <T,
K, V> ProcessorMetaSupplier writeMapP
(String mapName, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends V> toValueFn) Returns a supplier of processors forSinks.map(String, FunctionEx, FunctionEx)
.static ProcessorMetaSupplier
writeObservableP
(String name) Returns a supplier of processors forSinks.observable(java.lang.String)
.static ProcessorMetaSupplier
writeRemoteCacheP
(String cacheName, ClientConfig clientConfig) Returns a supplier of processors forSinks.remoteCache(String, ClientConfig)
.static ProcessorMetaSupplier
writeRemoteListP
(String listName, ClientConfig clientConfig) Returns a supplier of processors forSinks.remoteList(String, ClientConfig)
.static ProcessorMetaSupplier
writeRemoteMapP
(String mapName, ClientConfig clientConfig) Returns a supplier of processors forSinks.remoteMap(String, ClientConfig)
.static <T,
K, V> ProcessorMetaSupplier writeRemoteMapP
(String mapName, ClientConfig clientConfig, FunctionEx<? super T, ? extends K> toKeyFn, FunctionEx<? super T, ? extends V> toValueFn) Returns a supplier of processors forSinks.remoteMap(String, ClientConfig, FunctionEx, FunctionEx)
.static <T> ProcessorMetaSupplier
writeSocketP
(String host, int port, FunctionEx<? super T, ? extends String> toStringFn, Charset charset) Returns a supplier of processors forSinks.socket(String, int)
.
-
Method Details
-
writeMapP
Returns a supplier of processors forSinks.map(String)
. -
writeMapP
@Nonnull public static <T,K, ProcessorMetaSupplier writeMapPV> (@Nonnull String mapName, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends V> toValueFn) Returns a supplier of processors forSinks.map(String, FunctionEx, FunctionEx)
. -
writeRemoteMapP
@Nonnull public static ProcessorMetaSupplier writeRemoteMapP(@Nonnull String mapName, @Nonnull ClientConfig clientConfig) Returns a supplier of processors forSinks.remoteMap(String, ClientConfig)
. -
writeRemoteMapP
@Nonnull public static <T,K, ProcessorMetaSupplier writeRemoteMapPV> (@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends V> toValueFn) Returns a supplier of processors forSinks.remoteMap(String, ClientConfig, FunctionEx, FunctionEx)
. -
mergeMapP
@Nonnull public static <T,K, ProcessorMetaSupplier mergeMapPV> (@Nonnull String mapName, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends V> toValueFn, @Nonnull BinaryOperatorEx<V> mergeFn) Returns a supplier of processors forSinks.mapWithMerging(String, FunctionEx, FunctionEx, BinaryOperatorEx)
. -
mergeRemoteMapP
@Nonnull public static <T,K, ProcessorMetaSupplier mergeRemoteMapPV> (@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends V> toValueFn, @Nonnull BinaryOperatorEx<V> mergeFn) Returns a supplier of processors forSinks.remoteMapWithMerging(String, ClientConfig, FunctionEx, FunctionEx, BinaryOperatorEx)
. -
updateMapP
@Nonnull public static <T,K, ProcessorMetaSupplier updateMapPV> (@Nonnull String mapName, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull BiFunctionEx<? super V, ? super T, ? extends V> updateFn) Returns a supplier of processors forSinks.mapWithEntryProcessor(String, FunctionEx, FunctionEx)
. -
updateRemoteMapP
@Nonnull public static <T,K, ProcessorMetaSupplier updateRemoteMapPV> (@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull BiFunctionEx<? super V, ? super T, ? extends V> updateFn) Returns a supplier of processors forSinks.remoteMapWithUpdating(String, ClientConfig, FunctionEx, BiFunctionEx)
. -
updateMapP
@Nonnull public static <T,K, ProcessorMetaSupplier updateMapPV, R> (@Nonnull String mapName, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends EntryProcessor<K, V, R>> toEntryProcessorFn) Returns a supplier of processors forSinks.mapWithEntryProcessor(String, FunctionEx, FunctionEx)
. -
updateMapP
@Nonnull public static <T,K, ProcessorMetaSupplier updateMapPV, R> (int maxParallelAsyncOps, @Nonnull String mapName, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends EntryProcessor<K, V, R>> toEntryProcessorFn) Returns a supplier of processors forSinks.mapWithEntryProcessor(int, String, FunctionEx, FunctionEx)
. -
updateRemoteMapP
@Nonnull public static <T,K, ProcessorMetaSupplier updateRemoteMapPV, R> (@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull FunctionEx<? super T, ? extends K> toKeyFn, @Nonnull FunctionEx<? super T, ? extends EntryProcessor<K, V, R>> toEntryProcessorFn) Returns a supplier of processors forSinks.remoteMapWithEntryProcessor(String, ClientConfig, FunctionEx, FunctionEx)
. -
writeMapP
@Nonnull public static <T,K, ProcessorMetaSupplier writeMapPV> (com.hazelcast.jet.impl.connector.MapSinkConfiguration<T, K, V> configuration) Returns a supplier of processors -
updateMapP
@Nonnull public static <T,K, ProcessorMetaSupplier updateMapPV> (com.hazelcast.jet.impl.connector.MapSinkConfiguration<T, K, V> configuration) -
writeCacheP
Returns a supplier of processors forSinks.cache(String)
. -
writeRemoteCacheP
@Nonnull public static ProcessorMetaSupplier writeRemoteCacheP(@Nonnull String cacheName, @Nonnull ClientConfig clientConfig) Returns a supplier of processors forSinks.remoteCache(String, ClientConfig)
. -
writeListP
Returns a supplier of processors forSinks.list(String)
. -
writeRemoteListP
@Nonnull public static ProcessorMetaSupplier writeRemoteListP(@Nonnull String listName, @Nonnull ClientConfig clientConfig) Returns a supplier of processors forSinks.remoteList(String, ClientConfig)
. -
writeSocketP
public static <T> ProcessorMetaSupplier writeSocketP(@Nonnull String host, int port, @Nonnull FunctionEx<? super T, ? extends String> toStringFn, @Nonnull Charset charset) Returns a supplier of processors forSinks.socket(String, int)
. -
writeFileP
@Nonnull public static <T> ProcessorMetaSupplier writeFileP(@Nonnull String directoryName, @Nonnull Charset charset, @Nullable String datePattern, long maxFileSize, boolean exactlyOnce, @Nonnull FunctionEx<? super T, ? extends String> toStringFn) Returns a supplier of processors forSinks.filesBuilder(java.lang.String)
. -
writeBufferedP
@Nonnull public static <W,T> SupplierEx<Processor> writeBufferedP(@Nonnull FunctionEx<? super Processor.Context, ? extends W> createFn, @Nonnull BiConsumerEx<? super W, ? super T> onReceiveFn, @Nonnull ConsumerEx<? super W> flushFn) Shortcut forwriteBufferedP(FunctionEx, BiConsumerEx, ConsumerEx, ConsumerEx)
with a no-opdestroyFn
. -
writeBufferedP
@Nonnull public static <W,T> SupplierEx<Processor> writeBufferedP(@Nonnull FunctionEx<? super Processor.Context, ? extends W> createFn, @Nonnull BiConsumerEx<? super W, ? super T> onReceiveFn, @Nonnull ConsumerEx<? super W> flushFn, @Nonnull ConsumerEx<? super W> destroyFn) Returns a supplier of processors for a vertex that drains all the items from the inbox to an internal writer object and then does a flush. As each processor completes, it disposes of its writer by callingdestroyFn
.This is a useful building block to implement sinks with explicit control over resource management, buffering and flushing.
The returned processor will have preferred local parallelism of 1. It will not participate in state saving for fault tolerance.
- Type Parameters:
W
- type of the writerT
- type of the received item- Parameters:
createFn
- supplies the writer. The argument to this function is the context for the given processor.onReceiveFn
- function that Jet calls upon receiving each item for the sinkflushFn
- function that flushes the writerdestroyFn
- function that destroys the writer
-
writeJmsQueueP
@Nonnull public static <T> ProcessorMetaSupplier writeJmsQueueP(@Nonnull String queueName, boolean exactlyOnce, @Nonnull SupplierEx<? extends jakarta.jms.Connection> newConnectionFn, @Nonnull BiFunctionEx<? super jakarta.jms.Session, ? super T, ? extends jakarta.jms.Message> messageFn) Returns a supplier of processors forSinks.jmsQueueBuilder(com.hazelcast.function.SupplierEx<jakarta.jms.ConnectionFactory>)
. -
writeJmsTopicP
@Nonnull public static <T> ProcessorMetaSupplier writeJmsTopicP(@Nonnull String topicName, boolean exactlyOnce, @Nonnull SupplierEx<? extends jakarta.jms.Connection> newConnectionFn, @Nonnull BiFunctionEx<? super jakarta.jms.Session, ? super T, ? extends jakarta.jms.Message> messageFn) Returns a supplier of processors forSinks.jmsTopicBuilder(com.hazelcast.function.SupplierEx<jakarta.jms.ConnectionFactory>)
. -
writeJdbcP
@Nonnull public static <T> ProcessorMetaSupplier writeJdbcP(@Nullable String jdbcUrl, @Nonnull String updateQuery, @Nonnull SupplierEx<? extends CommonDataSource> dataSourceSupplier, @Nonnull BiConsumerEx<? super PreparedStatement, ? super T> bindFn, boolean exactlyOnce, int batchLimit) Returns a supplier of processors forSinks.jdbcBuilder()
.Notes
Until Jet 4.4, the batch size limit for the supplied processors used to be hard-coded to 50. Since Jet 4.5, this limit is now configurable and must be explicitly set using the
batchLimit
parameter. -
writeJdbcP
@Nonnull @Beta public static <T> ProcessorMetaSupplier writeJdbcP(@Nonnull String updateQuery, @Nonnull DataConnectionRef dataConnectionRef, @Nonnull BiConsumerEx<? super PreparedStatement, ? super T> bindFn, boolean exactlyOnce, int batchLimit) Returns a supplier of processors forSinks.jdbcBuilder()
.- Since:
- 5.2
-
writeObservableP
Returns a supplier of processors forSinks.observable(java.lang.String)
.- Since:
- Jet 4.0
-