public final class SinkProcessors extends Object
package-level documentation
.Modifier and Type | Method and Description |
---|---|
static <T,K,V> ProcessorMetaSupplier |
mergeMapP(String mapName,
DistributedFunction<? super T,? extends K> toKeyFn,
DistributedFunction<? super T,? extends V> toValueFn,
DistributedBinaryOperator<V> mergeFn)
Returns a supplier of processors for
Sinks.mapWithMerging(String, DistributedFunction, DistributedFunction,
DistributedBinaryOperator) . |
static <T,K,V> ProcessorMetaSupplier |
mergeRemoteMapP(String mapName,
ClientConfig clientConfig,
DistributedFunction<? super T,? extends K> toKeyFn,
DistributedFunction<? super T,? extends V> toValueFn,
DistributedBinaryOperator<V> mergeFn)
Returns a supplier of processors for
Sinks.remoteMapWithMerging(String, ClientConfig, DistributedFunction,
DistributedFunction, DistributedBinaryOperator) . |
static <T,K,V> ProcessorMetaSupplier |
updateMapP(String mapName,
DistributedFunction<? super T,? extends K> toKeyFn,
DistributedBiFunction<? super V,? super T,? extends V> updateFn)
Returns a supplier of processors for
Sinks.mapWithEntryProcessor(String, DistributedFunction, DistributedFunction) . |
static <T,K,V> ProcessorMetaSupplier |
updateMapP(String mapName,
DistributedFunction<? super T,? extends K> toKeyFn,
DistributedFunction<? super T,? extends EntryProcessor<K,V>> toEntryProcessorFn)
Returns a supplier of processors for
Sinks.mapWithEntryProcessor(String, DistributedFunction, DistributedFunction) . |
static <T,K,V> ProcessorMetaSupplier |
updateRemoteMapP(String mapName,
ClientConfig clientConfig,
DistributedFunction<? super T,? extends K> toKeyFn,
DistributedBiFunction<? super V,? super T,? extends V> updateFn)
Returns a supplier of processors for
Sinks.remoteMapWithUpdating(String, ClientConfig, DistributedFunction
, DistributedBiFunction) . |
static <T,K,V> ProcessorMetaSupplier |
updateRemoteMapP(String mapName,
ClientConfig clientConfig,
DistributedFunction<? super T,? extends K> toKeyFn,
DistributedFunction<? super T,? extends EntryProcessor<K,V>> toEntryProcessorFn)
Returns a supplier of processors for
Sinks.remoteMapWithEntryProcessor(String, ClientConfig, DistributedFunction,
DistributedFunction) . |
static <W,T> DistributedSupplier<Processor> |
writeBufferedP(DistributedFunction<? super Processor.Context,? extends W> createFn,
DistributedBiConsumer<? super W,? super T> onReceiveFn,
DistributedConsumer<? super W> flushFn)
Shortcut for
writeBufferedP(DistributedFunction,
DistributedBiConsumer, DistributedConsumer, DistributedConsumer) with
a no-op destroyFn . |
static <W,T> DistributedSupplier<Processor> |
writeBufferedP(DistributedFunction<? super Processor.Context,? extends W> createFn,
DistributedBiConsumer<? super W,? super T> onReceiveFn,
DistributedConsumer<? super W> flushFn,
DistributedConsumer<? 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 for
Sinks.cache(String) . |
static <T> ProcessorMetaSupplier |
writeFileP(String directoryName,
DistributedFunction<? super T,? extends String> toStringFn,
Charset charset,
boolean append)
Returns a supplier of processors for
Sinks.filesBuilder(java.lang.String) . |
static <T> ProcessorMetaSupplier |
writeJdbcP(String updateQuery,
DistributedSupplier<? extends Connection> connectionSupplier,
DistributedBiConsumer<? super PreparedStatement,? super T> bindFn)
Returns a supplier of processors for
Sinks.jdbc(String, DistributedSupplier, DistributedBiConsumer) . |
static <T> ProcessorMetaSupplier |
writeJmsQueueP(DistributedSupplier<? extends javax.jms.Connection> connectionSupplier,
DistributedFunction<? super javax.jms.Connection,? extends javax.jms.Session> sessionF,
DistributedBiFunction<? super javax.jms.Session,? super T,? extends javax.jms.Message> messageFn,
DistributedBiConsumer<? super javax.jms.MessageProducer,? super javax.jms.Message> sendFn,
DistributedConsumer<? super javax.jms.Session> flushFn,
String name)
Returns a supplier of processors for
Sinks.jmsQueueBuilder(com.hazelcast.jet.function.DistributedSupplier<javax.jms.ConnectionFactory>) . |
static <T> ProcessorMetaSupplier |
writeJmsTopicP(DistributedSupplier<? extends javax.jms.Connection> connectionSupplier,
DistributedFunction<? super javax.jms.Connection,? extends javax.jms.Session> sessionF,
DistributedBiFunction<? super javax.jms.Session,? super T,? extends javax.jms.Message> messageFn,
DistributedBiConsumer<? super javax.jms.MessageProducer,? super javax.jms.Message> sendFn,
DistributedConsumer<? super javax.jms.Session> flushFn,
String name)
Returns a supplier of processors for
Sinks.jmsTopicBuilder(com.hazelcast.jet.function.DistributedSupplier<javax.jms.ConnectionFactory>) . |
static ProcessorMetaSupplier |
writeListP(String listName)
Returns a supplier of processors for
Sinks.list(String) . |
static ProcessorMetaSupplier |
writeMapP(String mapName)
Returns a supplier of processors for
Sinks.map(String) . |
static ProcessorMetaSupplier |
writeRemoteCacheP(String cacheName,
ClientConfig clientConfig)
Returns a supplier of processors for
Sinks.remoteCache(String, ClientConfig) . |
static ProcessorMetaSupplier |
writeRemoteListP(String listName,
ClientConfig clientConfig)
Returns a supplier of processors for
Sinks.remoteList(String, ClientConfig) . |
static ProcessorMetaSupplier |
writeRemoteMapP(String mapName,
ClientConfig clientConfig)
Returns a supplier of processors for
Sinks.remoteMap(String, ClientConfig) . |
static <T> ProcessorMetaSupplier |
writeSocketP(String host,
int port,
DistributedFunction<? super T,? extends String> toStringFn,
Charset charset)
Returns a supplier of processors for
Sinks.socket(String, int) . |
@Nonnull public static ProcessorMetaSupplier writeMapP(@Nonnull String mapName)
Sinks.map(String)
.@Nonnull public static ProcessorMetaSupplier writeRemoteMapP(@Nonnull String mapName, @Nonnull ClientConfig clientConfig)
Sinks.remoteMap(String, ClientConfig)
.@Nonnull public static <T,K,V> ProcessorMetaSupplier mergeMapP(@Nonnull String mapName, @Nonnull DistributedFunction<? super T,? extends K> toKeyFn, @Nonnull DistributedFunction<? super T,? extends V> toValueFn, @Nonnull DistributedBinaryOperator<V> mergeFn)
Sinks.mapWithMerging(String, DistributedFunction, DistributedFunction,
DistributedBinaryOperator)
.@Nonnull public static <T,K,V> ProcessorMetaSupplier mergeRemoteMapP(@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull DistributedFunction<? super T,? extends K> toKeyFn, @Nonnull DistributedFunction<? super T,? extends V> toValueFn, @Nonnull DistributedBinaryOperator<V> mergeFn)
Sinks.remoteMapWithMerging(String, ClientConfig, DistributedFunction,
DistributedFunction, DistributedBinaryOperator)
.@Nonnull public static <T,K,V> ProcessorMetaSupplier updateMapP(@Nonnull String mapName, @Nonnull DistributedFunction<? super T,? extends K> toKeyFn, @Nonnull DistributedBiFunction<? super V,? super T,? extends V> updateFn)
Sinks.mapWithEntryProcessor(String, DistributedFunction, DistributedFunction)
.@Nonnull public static <T,K,V> ProcessorMetaSupplier updateRemoteMapP(@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull DistributedFunction<? super T,? extends K> toKeyFn, @Nonnull DistributedBiFunction<? super V,? super T,? extends V> updateFn)
Sinks.remoteMapWithUpdating(String, ClientConfig, DistributedFunction
, DistributedBiFunction)
.@Nonnull public static <T,K,V> ProcessorMetaSupplier updateMapP(@Nonnull String mapName, @Nonnull DistributedFunction<? super T,? extends K> toKeyFn, @Nonnull DistributedFunction<? super T,? extends EntryProcessor<K,V>> toEntryProcessorFn)
Sinks.mapWithEntryProcessor(String, DistributedFunction, DistributedFunction)
.@Nonnull public static <T,K,V> ProcessorMetaSupplier updateRemoteMapP(@Nonnull String mapName, @Nonnull ClientConfig clientConfig, @Nonnull DistributedFunction<? super T,? extends K> toKeyFn, @Nonnull DistributedFunction<? super T,? extends EntryProcessor<K,V>> toEntryProcessorFn)
Sinks.remoteMapWithEntryProcessor(String, ClientConfig, DistributedFunction,
DistributedFunction)
.@Nonnull public static ProcessorMetaSupplier writeCacheP(@Nonnull String cacheName)
Sinks.cache(String)
.@Nonnull public static ProcessorMetaSupplier writeRemoteCacheP(@Nonnull String cacheName, @Nonnull ClientConfig clientConfig)
Sinks.remoteCache(String, ClientConfig)
.@Nonnull public static ProcessorMetaSupplier writeListP(@Nonnull String listName)
Sinks.list(String)
.@Nonnull public static ProcessorMetaSupplier writeRemoteListP(@Nonnull String listName, @Nonnull ClientConfig clientConfig)
Sinks.remoteList(String, ClientConfig)
.public static <T> ProcessorMetaSupplier writeSocketP(@Nonnull String host, int port, @Nonnull DistributedFunction<? super T,? extends String> toStringFn, @Nonnull Charset charset)
Sinks.socket(String, int)
.@Nonnull public static <T> ProcessorMetaSupplier writeFileP(@Nonnull String directoryName, @Nonnull DistributedFunction<? super T,? extends String> toStringFn, @Nonnull Charset charset, boolean append)
Sinks.filesBuilder(java.lang.String)
.@Nonnull public static <W,T> DistributedSupplier<Processor> writeBufferedP(@Nonnull DistributedFunction<? super Processor.Context,? extends W> createFn, @Nonnull DistributedBiConsumer<? super W,? super T> onReceiveFn, @Nonnull DistributedConsumer<? super W> flushFn)
writeBufferedP(DistributedFunction,
DistributedBiConsumer, DistributedConsumer, DistributedConsumer)
with
a no-op destroyFn
.@Nonnull public static <W,T> DistributedSupplier<Processor> writeBufferedP(@Nonnull DistributedFunction<? super Processor.Context,? extends W> createFn, @Nonnull DistributedBiConsumer<? super W,? super T> onReceiveFn, @Nonnull DistributedConsumer<? super W> flushFn, @Nonnull DistributedConsumer<? super W> destroyFn)
destroyFn
.
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.
W
- type of the writerT
- type of the received itemcreateFn
- 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@Nonnull public static <T> ProcessorMetaSupplier writeJmsQueueP(@Nonnull DistributedSupplier<? extends javax.jms.Connection> connectionSupplier, @Nonnull DistributedFunction<? super javax.jms.Connection,? extends javax.jms.Session> sessionF, @Nonnull DistributedBiFunction<? super javax.jms.Session,? super T,? extends javax.jms.Message> messageFn, @Nonnull DistributedBiConsumer<? super javax.jms.MessageProducer,? super javax.jms.Message> sendFn, @Nonnull DistributedConsumer<? super javax.jms.Session> flushFn, @Nonnull String name)
Sinks.jmsQueueBuilder(com.hazelcast.jet.function.DistributedSupplier<javax.jms.ConnectionFactory>)
.@Nonnull public static <T> ProcessorMetaSupplier writeJmsTopicP(@Nonnull DistributedSupplier<? extends javax.jms.Connection> connectionSupplier, @Nonnull DistributedFunction<? super javax.jms.Connection,? extends javax.jms.Session> sessionF, @Nonnull DistributedBiFunction<? super javax.jms.Session,? super T,? extends javax.jms.Message> messageFn, @Nonnull DistributedBiConsumer<? super javax.jms.MessageProducer,? super javax.jms.Message> sendFn, @Nonnull DistributedConsumer<? super javax.jms.Session> flushFn, @Nonnull String name)
Sinks.jmsTopicBuilder(com.hazelcast.jet.function.DistributedSupplier<javax.jms.ConnectionFactory>)
.@Nonnull public static <T> ProcessorMetaSupplier writeJdbcP(@Nonnull String updateQuery, @Nonnull DistributedSupplier<? extends Connection> connectionSupplier, @Nonnull DistributedBiConsumer<? super PreparedStatement,? super T> bindFn)
Sinks.jdbc(String, DistributedSupplier, DistributedBiConsumer)
.Copyright © 2018 Hazelcast, Inc.. All rights reserved.