@Beta public final class Hz3Sources extends Object
The usage is similar to Sources.remoteMap(String, ClientConfig)
.
Because of incompatible APIs the configuration is passed as an XML
document in a string - note that the XML configuration must conform
to 3.x schema - see
https://www.hazelcast.com/schema/config/.
Usage:
String clientConfig = "...";
BatchSource<Map.Entry<Integer, String>> source =
Hz3Sources.remoteMap("test-map", clientConfig);
p.readFrom(source);
...
Additionally, a custom classpath element for the source
stage
must be set with the Hazelcast 3 client and the Hazelcast 3 connector:
List<String> jars = new ArrayList<>();
jars.add("hazelcast-3.12.13.jar");
jars.add("hazelcast-client-3.12.13.jar");
jars.add("hazelcast-3-connector-impl.jar");
JobConfig config = new JobConfig();
config.addCustomClasspaths(source.name(), jars)
The jars must exist in the directory specified by the
ClusterProperty.PROCESSOR_CUSTOM_LIB_DIR
directory. This is already set up for the regular zip distribution.
Modifier and Type | Method and Description |
---|---|
static ProcessorSupplier |
readRemoteMapP(String mapName,
String clientXml)
Returns a supplier of processors for
Sources.remoteMap(String, ClientConfig) . |
static <K,V> BatchSource<Map.Entry<K,V>> |
remoteMap(String mapName,
String clientXml)
Returns a source that fetches entries from the Hazelcast
IMap
with the specified name in a remote cluster identified by the supplied
XML configuration. |
@Beta @Nonnull public static <K,V> BatchSource<Map.Entry<K,V>> remoteMap(@Nonnull String mapName, @Nonnull String clientXml)
IMap
with the specified name in a remote cluster identified by the supplied
XML configuration.mapName
- name of the mapclientXml
- client configuration for the remote cluster@Beta @Nonnull public static ProcessorSupplier readRemoteMapP(@Nonnull String mapName, @Nonnull String clientXml)
Sources.remoteMap(String, ClientConfig)
.Copyright © 2023 Hazelcast, Inc.. All rights reserved.