com.hazelcast.jet.config

## Class JetConfig

- java.lang.Object
- - com.hazelcast.jet.config.JetConfig

-     public class JetConfig
      extends Object

  Configuration object for a Jet instance.

- - ### Field Summary

    Fields
    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 Summary

    Constructors
    Constructor and Description
    `JetConfig()` Creates a new, empty `JetConfig` with the default configuration.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_JET_MULTICAST_PORT

          public static final int DEFAULT_JET_MULTICAST_PORT

      The default port number for the cluster auto-discovery mechanism's multicast communication.
      See Also:
        Constant Field Values

    - #### DEFAULT_GROUP_NAME

          public static final String DEFAULT_GROUP_NAME

      The default group name for a Jet cluster See `GroupConfig`
      See Also:
        Constant Field Values

    - #### DEFAULT_GROUP_PASSWORD

          public static final String DEFAULT_GROUP_PASSWORD

      The default group password for a Jet cluster. See `GroupConfig`
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JetConfig

          public JetConfig()

      Creates a new, empty `JetConfig` with the default configuration. Doesn't consider any configuration XML files.

  - ### Method Detail

    - #### loadDefault

          @Nonnull
          public static JetConfig loadDefault()

      Loads JetConfig using the default lookup mechanism to locate the configuration file. Loads the nested Hazelcast config also by using its default lookup mechanism. Uses `System.getProperties()` to resolve the variables in the XML.

      This is the lookup mechanism for the Jet configuration:

      1. Read the system property `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.
      2. Look for `hazelcast-jet.xml` in the working directory.
      3. Look for `hazelcast-jet.xml` in the classpath.
      4. Load the default XML configuration packaged in Jet's JAR.
      The mechanism is the same for the nested Hazelcast config, just with the `hazelcast.config` system property.

    - #### loadDefault

          @Nonnull
          public static JetConfig loadDefault(@Nonnull
                                                       Properties properties)

      Loads JetConfig using the built-in `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.

    - #### loadFromClasspath

          @Nonnull
          public static JetConfig loadFromClasspath(@Nonnull
                                                             String resource)

      Uses the thread's context class loader to load JetConfig from the classpath resource named by the argument. Uses `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`.

      Parameters:
        `resource` - names the classpath resource containing the XML configuration file
      Throws:
        `HazelcastException` - if the XML content is invalid
        `IllegalArgumentException` - if classpath resource is not found

    - #### loadFromClasspath

          @Nonnull
          public static JetConfig loadFromClasspath(@Nonnull
                                                             String resource,
                                                             @Nonnull
                                                             Properties properties)

      Uses the thread's context class loader to load JetConfig from the classpath resource named by the argument. Uses the given `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`.

      Parameters:
        `resource` - the classpath resource, an XML configuration file on the classpath
      Throws:
        `HazelcastException` - if the XML content is invalid
        `IllegalArgumentException` - if classpath resource is not found

    - #### loadFromStream

          @Nonnull
          public static JetConfig loadFromStream(@Nonnull
                                                          InputStream configStream)

      Loads JetConfig from the supplied input stream. Uses `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`.

      Parameters:
        `configStream` - the InputStream to load the config from
      Throws:
        `HazelcastException` - if the XML content is invalid

    - #### loadFromStream

          @Nonnull
          public static JetConfig loadFromStream(@Nonnull
                                                          InputStream configStream,
                                                          @Nonnull
                                                          Properties properties)

      Loads JetConfig from the supplied input stream. Uses the given `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`.

      Parameters:
        `configStream` - the InputStream to load the config from
        `properties` - the properties to resolve variables in the XML
      Throws:
        `HazelcastException` - if the XML content is invalid

    - #### getHazelcastConfig

          @Nonnull
          public Config getHazelcastConfig()

      Returns the configuration object for the underlying Hazelcast IMDG instance.

    - #### setHazelcastConfig

          @Nonnull
          public JetConfig setHazelcastConfig(@Nonnull
                                                       Config config)

      Sets the underlying Hazelcast IMDG instance's configuration object.

    - #### getInstanceConfig

          @Nonnull
          public InstanceConfig getInstanceConfig()

      Returns the Jet instance config.

    - #### setInstanceConfig

          @Nonnull
          public JetConfig setInstanceConfig(@Nonnull
                                                      InstanceConfig instanceConfig)

      Sets the Jet instance config.

    - #### getMetricsConfig

          @Nonnull
          public MetricsConfig getMetricsConfig()

      Returns the metrics collection config.

    - #### setMetricsConfig

          @Nonnull
          public JetConfig setMetricsConfig(MetricsConfig metricsConfig)

      Sets the metrics collection config.

    - #### getProperties

          public Properties getProperties()

      Returns the Jet-specific configuration properties.

    - #### setProperties

          public JetConfig setProperties(Properties properties)

      Sets the Jet-specific configuration properties.

    - #### getDefaultEdgeConfig

          public EdgeConfig getDefaultEdgeConfig()

      Returns the default DAG edge configuration.

    - #### setDefaultEdgeConfig

          public JetConfig setDefaultEdgeConfig(EdgeConfig defaultEdgeConfig)

      Sets the configuration object that specifies the defaults to use for a DAG edge configuration.

Copyright © 2018. All rights reserved.