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 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(ClassLoader classLoader,
String resource)
Creates a JetConfig which is loaded from a classpath resource.
|
static JetConfig |
loadFromClasspath(ClassLoader classLoader,
String resource,
Properties properties)
Creates a JetConfig which is loaded from a classpath resource.
|
static JetConfig |
loadFromClasspath(String resource)
Deprecated.
|
static JetConfig |
loadFromClasspath(String resource,
Properties properties)
Deprecated.
|
static JetConfig |
loadFromFile(File configFile)
Creates a JetConfig based on a Hazelcast Jet configuration file (XML or YAML)
and uses the System.properties to resolve variables in the file.
|
static JetConfig |
loadFromFile(File configFile,
Properties properties)
Creates a JetConfig based on a Hazelcast Jet configuration file (XML or YAML).
|
static JetConfig |
loadFromStream(InputStream configStream)
Deprecated.
|
static JetConfig |
loadFromStream(InputStream configStream,
Properties properties)
|
static JetConfig |
loadXmlFromStream(InputStream configStream)
Loads JetConfig from the supplied input stream.
|
static JetConfig |
loadXmlFromStream(InputStream configStream,
Properties properties)
Loads JetConfig from the supplied input stream.
|
static JetConfig |
loadXmlFromString(String xml)
Creates a JetConfig from the provided XML string and uses the
System.properties to resolve variables in the XML.
|
static JetConfig |
loadXmlFromString(String xml,
Properties properties)
Creates a JetConfig from the provided XML string and properties to resolve
the variables in the XML.
|
static JetConfig |
loadYamlFromStream(InputStream configStream)
Loads JetConfig from the supplied input stream.
|
static JetConfig |
loadYamlFromStream(InputStream configStream,
Properties properties)
Loads JetConfig from the supplied input stream.
|
static JetConfig |
loadYamlFromString(String yaml)
Creates a JetConfig from the provided YAML string and uses the
System.properties to resolve variables in the YAML.
|
static JetConfig |
loadYamlFromString(String yaml,
Properties properties)
Creates a JetConfig from the provided YAML string and properties to resolve
the variables in the YAML.
|
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.
|
JetConfig |
setProperty(String name,
String value)
Sets the value of the specified property.
|
public static final int DEFAULT_JET_MULTICAST_PORT
public static final String DEFAULT_GROUP_NAME
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 or YAML.
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-jet.yaml
in the working directory.
hazelcast-jet.yaml
in the classpath.
hazelcast.config
system property.@Nonnull public static JetConfig loadDefault(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 or YAML.@Nonnull public static JetConfig loadFromClasspath(ClassLoader classLoader, String resource)
classLoader
- the ClassLoader used to load the resourceresource
- the resource, an XML or YAML configuration file from
the classpath, without the "classpath:" prefixIllegalArgumentException
- if classLoader or resource is null
,
or if the resource is not foundInvalidConfigurationException
- if the resource content is invalid@Nonnull public static JetConfig loadFromClasspath(ClassLoader classLoader, String resource, Properties properties)
properties
to resolve the variables in the resource.classLoader
- the ClassLoader used to load the resourceresource
- the resource, an XML or YAML configuration file from
the classpath, without the "classpath:" prefixproperties
- the properties used to resolve variables in the resourceIllegalArgumentException
- if classLoader or resource is null
,
or if the resource is not foundInvalidConfigurationException
- if the resource content is invalid@Nonnull public static JetConfig loadFromFile(File configFile) throws FileNotFoundException
configFile
- the path of the Hazelcast Jet configuration fileFileNotFoundException
- if the file doesn't existInvalidConfigurationException
- if the file content is invalid@Nonnull public static JetConfig loadFromFile(File configFile, Properties properties) throws FileNotFoundException
properties
to resolve the variables in the file.configFile
- the path of the Hazelcast Jet configuration fileproperties
- the Properties to resolve variables in the fileIllegalArgumentException
- if configFile or properties is null
FileNotFoundException
- if the file doesn't existInvalidConfigurationException
- if the file content is invalid@Nonnull public static JetConfig loadXmlFromStream(@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 loadXmlFromStream(@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 static JetConfig loadXmlFromString(String xml)
xml
- the XML content as a Hazelcast Jet XML StringIllegalArgumentException
- if the XML is null or emptyInvalidConfigurationException
- if the XML content is invalid@Nonnull public static JetConfig loadXmlFromString(String xml, Properties properties)
xml
- the XML content as a Hazelcast Jet XML StringIllegalArgumentException
- if the XML is null or empty or if
properties is nullInvalidConfigurationException
- if the XML content is invalid@Nonnull public static JetConfig loadYamlFromStream(@Nonnull InputStream configStream)
System.getProperties()
to resolve the variables in the YAML.
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, ClasspathYamlConfig
or FileSystemYamlConfig
.
configStream
- the InputStream to load the config fromHazelcastException
- if the YAML content is invalid@Nonnull public static JetConfig loadYamlFromStream(@Nonnull InputStream configStream, @Nonnull Properties properties)
properties
to resolve the variables in the YAML.
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, ClasspathYamlConfig
or FileSystemYamlConfig
.
configStream
- the InputStream to load the config fromHazelcastException
- if the YAML content is invalid@Nonnull public static JetConfig loadYamlFromString(String yaml)
yaml
- the YAML content as a Hazelcast Jet YAML StringIllegalArgumentException
- if the YAML is null or emptyInvalidConfigurationException
- if the YAML content is invalid@Nonnull public static JetConfig loadYamlFromString(String yaml, Properties properties)
yaml
- the YAML content as a Hazelcast Jet YAML StringIllegalArgumentException
- if the YAML is null or empty or if
properties is nullInvalidConfigurationException
- if the YAML content is invalid@Nonnull @Deprecated public static JetConfig loadFromClasspath(@Nonnull String resource)
System.getProperties()
to resolve the variables in the XML or Yaml.
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 or Yaml configuration fileHazelcastException
- if the XML or Yaml content is invalidIllegalArgumentException
- if classpath resource is not found@Nonnull @Deprecated 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 @Deprecated 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 @Deprecated 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(@Nonnull MetricsConfig metricsConfig)
@Nonnull public Properties getProperties()
@Nonnull public JetConfig setProperties(@Nonnull Properties properties)
@Nonnull public JetConfig setProperty(@Nonnull String name, @Nonnull String value)
@Nonnull public EdgeConfig getDefaultEdgeConfig()
@Nonnull public JetConfig setDefaultEdgeConfig(@Nonnull EdgeConfig defaultEdgeConfig)
Copyright © 2019 Hazelcast, Inc.. All rights reserved.