Modifier and Type | Method and Description |
---|---|
static <E extends Map.Entry> |
cache(String cacheName)
Returns a sink that puts
Map.Entry s it receives into a Hazelcast
ICache with the specified name. |
static <E> Sink<E> |
files(String directoryName)
Convenience for
files(String, DistributedFunction, Charset,
boolean) with the UTF-8 charset and with overwriting of existing files. |
static <E> Sink<E> |
files(String directoryName,
DistributedFunction<E,String> toStringFn)
Convenience for
files(String, DistributedFunction, Charset,
boolean) with the UTF-8 charset and with overwriting of existing files. |
static <E> Sink<E> |
files(String directoryName,
DistributedFunction<E,String> toStringFn,
Charset charset,
boolean append)
Returns a sink that that writes the items it receives to files.
|
static <E> Sink<E> |
fromProcessor(String sinkName,
ProcessorMetaSupplier metaSupplier)
Returns a sink constructed directly from the given Core API processor
meta-supplier.
|
static <E> Sink<E> |
list(String listName)
Returns a sink that adds the items it receives to a Hazelcast
IList with the specified name. |
static <E> Sink<E> |
logger()
|
static <E> Sink<E> |
logger(DistributedFunction<E,String> toStringFn)
Returns a sink that logs all the data items it receives, at the INFO
level to the log category
WriteLoggerP . |
static <E extends Map.Entry> |
map(String mapName)
Returns a sink that puts
Map.Entry s it receives into a Hazelcast
IMap with the specified name. |
static <E extends Map.Entry> |
remoteCache(String cacheName,
com.hazelcast.client.config.ClientConfig clientConfig)
Returns a sink that puts
Map.Entry s it receives into a Hazelcast
ICache with the specified name in a remote cluster identified by
the supplied ClientConfig . |
static <E> Sink<E> |
remoteList(String listName,
com.hazelcast.client.config.ClientConfig clientConfig)
Returns a sink that adds the items it receives to a Hazelcast
IList with the specified name in a remote cluster identified by the
supplied ClientConfig . |
static <E extends Map.Entry> |
remoteMap(String mapName,
com.hazelcast.client.config.ClientConfig clientConfig)
Returns a sink that puts
Map.Entry s it receives into a Hazelcast
IMap with the specified name in a remote cluster identified by
the supplied ClientConfig . |
static <E> Sink<E> |
socket(String host,
int port)
Convenience for
socket(String, int, DistributedFunction,
Charset) with Object.toString as the conversion function and
UTF-8 as the charset. |
static <E> Sink<E> |
socket(String host,
int port,
DistributedFunction<E,String> toStringFn)
Convenience for
socket(String, int, DistributedFunction,
Charset) with UTF-8 as the charset. |
static <E> Sink<E> |
socket(String host,
int port,
DistributedFunction<E,String> toStringFn,
Charset charset)
Returns a sink that connects to the specified TCP socket and writes to
it a string representation of the items it receives.
|
public static <E> Sink<E> fromProcessor(String sinkName, ProcessorMetaSupplier metaSupplier)
sinkName
- user-friendly sink namemetaSupplier
- the processor meta-supplierpublic static <E extends Map.Entry> Sink<E> map(String mapName)
Map.Entry
s it receives into a Hazelcast
IMap
with the specified name.
This sink provides the exactly-once guarantee thanks to idempotent updates. It means that the value with the same key is not appended, but overwritten. After the job is restarted from snapshot, duplicate items will not change the state in the target map.
public static <E extends Map.Entry> Sink<E> remoteMap(String mapName, com.hazelcast.client.config.ClientConfig clientConfig)
Map.Entry
s it receives into a Hazelcast
IMap
with the specified name in a remote cluster identified by
the supplied ClientConfig
.
This sink provides the exactly-once guarantee thanks to idempotent updates. It means that the value with the same key is not appended, but overwritten. After the job is restarted from snapshot, duplicate items will not change the state in the target map.
public static <E extends Map.Entry> Sink<E> cache(String cacheName)
Map.Entry
s it receives into a Hazelcast
ICache
with the specified name.
This sink provides the exactly-once guarantee thanks to idempotent updates. It means that the value with the same key is not appended, but overwritten. After the job is restarted from snapshot, duplicate items will not change the state in the target map.
public static <E extends Map.Entry> Sink<E> remoteCache(String cacheName, com.hazelcast.client.config.ClientConfig clientConfig)
Map.Entry
s it receives into a Hazelcast
ICache
with the specified name in a remote cluster identified by
the supplied ClientConfig
.
This sink provides the exactly-once guarantee thanks to idempotent updates. It means that the value with the same key is not appended, but overwritten. After the job is restarted from snapshot, duplicate items will not change the state in the target map.
public static <E> Sink<E> list(String listName)
IList
with the specified name.
No state is saved to snapshot for this sink. After the job is restarted, the items will likely be duplicated, providing an at-least-once guarantee.
public static <E> Sink<E> remoteList(String listName, com.hazelcast.client.config.ClientConfig clientConfig)
IList
with the specified name in a remote cluster identified by the
supplied ClientConfig
.
No state is saved to snapshot for this sink. After the job is restarted, the items will likely be duplicated, providing an at-least-once guarantee.
public static <E> Sink<E> socket(@Nonnull String host, int port, @Nonnull DistributedFunction<E,String> toStringFn, @Nonnull Charset charset)
toStringFn
function and encodes the string using the supplied Charset
. It
follows each item with a newline character.
No state is saved to snapshot for this sink. After the job is restarted, the items will likely be duplicated, providing an at-least-once guarantee.
public static <E> Sink<E> socket(@Nonnull String host, int port, @Nonnull DistributedFunction<E,String> toStringFn)
socket(String, int, DistributedFunction,
Charset)
with UTF-8 as the charset.public static <E> Sink<E> socket(@Nonnull String host, int port)
socket(String, int, DistributedFunction,
Charset)
with Object.toString
as the conversion function and
UTF-8 as the charset.@Nonnull public static <E> Sink<E> files(@Nonnull String directoryName, @Nonnull DistributedFunction<E,String> toStringFn, @Nonnull Charset charset, boolean append)
The sink converts an item to its string representation using the
supplied toStringFn
function and encodes the string using the
supplied Charset
. It follows each item with a platform-specific
line separator.
No state is saved to snapshot for this sink. After the job is restarted, the items will likely be duplicated, providing an at-least-once guarantee.
directoryName
- directory to create the files in. Will be created
if it doesn't exist. Must be the same on all members.toStringFn
- a function to convert items to String (a formatter)charset
- charset used to encode the file outputappend
- whether to append (true
) or overwrite (false
)
an existing file@Nonnull public static <E> Sink<E> files(@Nonnull String directoryName, @Nonnull DistributedFunction<E,String> toStringFn)
files(String, DistributedFunction, Charset,
boolean)
with the UTF-8 charset and with overwriting of existing files.@Nonnull public static <E> Sink<E> files(@Nonnull String directoryName)
files(String, DistributedFunction, Charset,
boolean)
with the UTF-8 charset and with overwriting of existing files.@Nonnull public static <E> Sink<E> logger(DistributedFunction<E,String> toStringFn)
WriteLoggerP
. It doesn't log watermark
items.
The sink logs each item on whichever cluster member it happens to receive it. Its primary purpose is for development use, when running Jet on a local machine.
E
- stream item typetoStringFn
- a function that returns a string representation of a stream itemCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.