public class JetConfig extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_GROUP_NAME
The default group name for a Jet cluster
See
GroupConfig |
static String |
DEFAULT_GROUP_PASSWORD
The default group password for a Jet cluster.
|
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, empty
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.
|
MetricsConfig |
getMetricsConfig()
Returns the metrics collection 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 |
setMetricsConfig(MetricsConfig metricsConfig)
Sets the metrics collection config.
|
JetConfig |
setProperties(Properties properties)
Sets the Jet-specific configuration properties.
|
public static final int DEFAULT_JET_MULTICAST_PORT
public static final String DEFAULT_GROUP_NAME
GroupConfig
public static final String DEFAULT_GROUP_PASSWORD
GroupConfig
public JetConfig()
JetConfig
with the default configuration.
Doesn't consider any configuration XML files.@Nonnull 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.@Nonnull 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.@Nonnull 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 found@Nonnull public 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 found@Nonnull public 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 invalid@Nonnull public 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 invalid@Nonnull public Config getHazelcastConfig()
@Nonnull public JetConfig setHazelcastConfig(@Nonnull Config config)
@Nonnull public InstanceConfig getInstanceConfig()
@Nonnull public JetConfig setInstanceConfig(@Nonnull InstanceConfig instanceConfig)
@Nonnull public MetricsConfig getMetricsConfig()
@Nonnull public JetConfig setMetricsConfig(MetricsConfig metricsConfig)
public Properties getProperties()
public JetConfig setProperties(Properties properties)
public EdgeConfig getDefaultEdgeConfig()
public JetConfig setDefaultEdgeConfig(EdgeConfig defaultEdgeConfig)
Copyright © 2018 Hazelcast, Inc.. All rights reserved.