public class JetConfig extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_JET_MULTICAST_PORT
The default port number for the cluster auto-discovery mechanism's
multicast communication.
|
Constructor and Description |
---|
JetConfig()
Creates a new JetConfig with the default configuration.
|
Modifier and Type | Method and Description |
---|---|
EdgeConfig |
getDefaultEdgeConfig()
Returns the default DAG edge configuration.
|
Config |
getHazelcastConfig()
Returns the configuration object for the underlying Hazelcast IMDG
instance.
|
InstanceConfig |
getInstanceConfig()
Returns the Jet instance config.
|
Properties |
getProperties()
Returns the Jet-specific configuration properties.
|
static JetConfig |
loadDefault()
Loads JetConfig using the default lookup mechanism to locate the
configuration file.
|
static JetConfig |
loadDefault(Properties properties)
Loads JetConfig using the built-in
lookup mechanism
to locate the configuration file. |
static JetConfig |
loadFromClasspath(String resource)
Uses the thread's context class loader to load JetConfig from the
classpath resource named by the argument.
|
static JetConfig |
loadFromClasspath(String resource,
Properties properties)
Uses the thread's context class loader to load JetConfig from the
classpath resource named by the argument.
|
static JetConfig |
loadFromStream(InputStream configStream)
Loads JetConfig from the supplied input stream.
|
static JetConfig |
loadFromStream(InputStream configStream,
Properties properties)
Loads JetConfig from the supplied input stream.
|
JetConfig |
setDefaultEdgeConfig(EdgeConfig defaultEdgeConfig)
Sets the configuration object that specifies the defaults to use
for a DAG edge configuration.
|
JetConfig |
setHazelcastConfig(Config config)
Sets the underlying Hazelcast IMDG instance's configuration object.
|
JetConfig |
setInstanceConfig(InstanceConfig instanceConfig)
Sets the Jet instance config.
|
JetConfig |
setProperties(Properties properties)
Sets the Jet-specific configuration properties.
|
public static final int DEFAULT_JET_MULTICAST_PORT
public JetConfig()
public static JetConfig loadDefault()
System.getProperties()
to resolve the variables in the XML.
This is the lookup mechanism for the Jet configuration:
hazelcast.jet.config
. If it starts with
classpath:
, treat it as a classpath resource, otherwise it's a
file pathname. If it's defined but Jet can't find the file it specifies,
startup fails.
hazelcast-jet.xml
in the working directory.
hazelcast-jet.xml
in the classpath.
hazelcast.config
system property.public static JetConfig loadDefault(@Nonnull Properties properties)
lookup mechanism
to locate the configuration file. Loads the nested Hazelcast config also by using the lookup
mechanism. Uses the given properties
to resolve the variables in
the XML.public static JetConfig loadFromClasspath(@Nonnull String resource)
System.getProperties()
to resolve the variables in the XML.
This method loads the nested Hazelcast
config using the built-in lookup mechanism
, but
you can replace it afterwards by calling setHazelcastConfig()
with, for example, ClasspathXmlConfig
or FileSystemXmlConfig
.
resource
- names the classpath resource containing the XML configuration fileHazelcastException
- if the XML content is invalidIllegalArgumentException
- if classpath resource is not foundpublic static JetConfig loadFromClasspath(@Nonnull String resource, @Nonnull Properties properties)
properties
to resolve the variables in the XML.
This method loads the nested Hazelcast
config using the built-in lookup mechanism
, but
you can replace it afterwards by calling setHazelcastConfig()
with, for example, ClasspathXmlConfig
or FileSystemXmlConfig
.
resource
- the classpath resource, an XML configuration file on the
classpathHazelcastException
- if the XML content is invalidIllegalArgumentException
- if classpath resource is not foundpublic static JetConfig loadFromStream(@Nonnull InputStream configStream)
System.getProperties()
to resolve the variables in the XML.
This method loads the nested Hazelcast
config using the built-in lookup mechanism
, but
you can replace it afterwards by calling setHazelcastConfig()
with, for example, ClasspathXmlConfig
or FileSystemXmlConfig
.
configStream
- the InputStream to load the config fromHazelcastException
- if the XML content is invalidpublic static JetConfig loadFromStream(@Nonnull InputStream configStream, @Nonnull Properties properties)
properties
to resolve the variables in the XML.
This method loads the nested Hazelcast
config using the built-in lookup mechanism
, but
you can replace it afterwards by calling setHazelcastConfig()
with, for example, ClasspathXmlConfig
or FileSystemXmlConfig
.
configStream
- the InputStream to load the config fromproperties
- the properties to resolve variables in the XMLHazelcastException
- if the XML content is invalidpublic Config getHazelcastConfig()
public JetConfig setHazelcastConfig(Config config)
public InstanceConfig getInstanceConfig()
public JetConfig setInstanceConfig(InstanceConfig instanceConfig)
public Properties getProperties()
public JetConfig setProperties(Properties properties)
public EdgeConfig getDefaultEdgeConfig()
public JetConfig setDefaultEdgeConfig(EdgeConfig defaultEdgeConfig)
Copyright © 2018 Hazelcast, Inc.. All rights reserved.