Class JobConfig

java.lang.Object
com.hazelcast.jet.config.JobConfig
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public class JobConfig extends Object implements IdentifiedDataSerializable
Contains the configuration specific to one Hazelcast Jet job.

Serialized form of this class should not be changed due to backward compatibility for JobResult.

Since:
Jet 3.0
See Also:
  • Constructor Details

    • JobConfig

      public JobConfig()
  • Method Details

    • getName

      @Nullable public String getName()
      Returns the name of the job or null if no name was given.
    • setName

      @Nonnull public JobConfig setName(@Nullable String name)
      Sets the name of the job. There can be at most one active job in the cluster with particular name, however, the name can be reused after the previous job with that name completed or failed. See JetService.newJobIfAbsent(com.hazelcast.jet.core.DAG, com.hazelcast.jet.config.JobConfig). An active job is a job that is running, suspended or waiting to be run.

      The job name is printed in logs and is visible in Management Center.

      The default value is null. Must be set to null for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 3.0
    • isSplitBrainProtectionEnabled

      public boolean isSplitBrainProtectionEnabled()
      Tells whether split brain protection is enabled.
    • setSplitBrainProtection

      @Nonnull public JobConfig setSplitBrainProtection(boolean isEnabled)
      Configures the split brain protection feature. When enabled, Jet will restart the job after a topology change only if the cluster quorum is satisfied. The quorum value is

      cluster size at job submission time / 2 + 1.

      The job can be restarted only if the size of the cluster after restart is at least the quorum value. Only one of the clusters formed due to a split-brain condition can satisfy the quorum. For example, if at the time of job submission the cluster size was 5 and a network partition causes two clusters with sizes 3 and 2 to form, the job will restart only on the cluster with size 3.

      Adding new nodes to the cluster after starting the job may defeat this mechanism. For instance, if there are 5 members at submission time (i.e., the quorum value is 3) and later a new node joins, a split into two clusters of size 3 will allow the job to be restarted on both sides.

      Split-brain protection is disabled by default.

      If auto scaling is disabled and you manually Job.resume() the job, the job won't start executing until the quorum is met, but will remain in the resumed state.

      Ignored for light jobs.

      Returns:
      this instance for fluent API
    • isAutoScaling

      public boolean isAutoScaling()
      Returns whether auto-scaling is enabled, see setAutoScaling(boolean).
    • setAutoScaling

      public JobConfig setAutoScaling(boolean enabled)
      Sets whether Jet will scale the job up or down when a member is added or removed from the cluster. Enabled by default. Ignored for light jobs.
       +--------------------------+-----------------------+----------------+
       |       Auto scaling       |     Member added      | Member removed |
       +--------------------------+-----------------------+----------------+
       | Enabled                  | restart (after delay) | restart        |
       | Disabled - snapshots on  | no action             | suspend        |
       | Disabled - snapshots off | no action             | fail           |
       +--------------------------+-----------------------+----------------+
       
      Returns:
      this instance for fluent API
      See Also:
    • isSuspendOnFailure

      public boolean isSuspendOnFailure()
      Returns whether the job will be suspended on failure, see setSuspendOnFailure(boolean).
      Since:
      Jet 4.3
    • setSuspendOnFailure

      public JobConfig setSuspendOnFailure(boolean suspendOnFailure)
      Sets what happens if the job execution fails:
      • If enabled, the job will be suspended. It can later be resumed or upgraded and the computation state will be preserved.
      • If disabled, the job will be terminated. The state snapshots will be deleted.

      By default, it's disabled. Ignored for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.3
    • getProcessingGuarantee

      @Nonnull public ProcessingGuarantee getProcessingGuarantee()
      Returns the configured processing guarantee.
    • setProcessingGuarantee

      @Nonnull public JobConfig setProcessingGuarantee(@Nonnull ProcessingGuarantee processingGuarantee)
      Set the processing guarantee for the job. When the processing guarantee is set to at-least-once or exactly-once, the snapshot interval can be configured via setSnapshotIntervalMillis(long), otherwise it will default to 10 seconds.

      The default value is ProcessingGuarantee.NONE. Must be set to NONE for light jobs.

      Returns:
      this instance for fluent API
    • getSnapshotIntervalMillis

      public long getSnapshotIntervalMillis()
      Returns the configured snapshot interval.
    • setSnapshotIntervalMillis

      @Nonnull public JobConfig setSnapshotIntervalMillis(long snapshotInterval)
      Sets the snapshot interval in milliseconds — the interval between the completion of the previous snapshot and the start of a new one. Must be set to a positive value. This setting is only relevant with at-least-once or exactly-once processing guarantees.

      Default value is set to 10 seconds.

      Returns:
      this instance for fluent API
    • addClass

      @Nonnull public JobConfig addClass(@Nonnull Class<?>... classes)
      Adds the given classes and recursively all their nested (inner & anonymous) classes to the Jet job's classpath. They will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. (An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.)

      See also addJar(java.net.URL) and addClasspathResource(java.net.URL).

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addPackage

      @Nonnull public JobConfig addPackage(@Nonnull String... packages)
      Adds recursively all the classes and resources in given packages to the Jet job's classpath. They will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. (An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.)

      See also addJar(java.net.URL) and addClasspathResource(java.net.URL).

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.1
    • addJar

      @Nonnull public JobConfig addJar(@Nonnull URL url)
      Adds a JAR whose contents will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.

      This variant identifies the JAR with a URL, which must contain at least one path segment. The last path segment ("filename") will be used as the resource ID - if there's already a resource with that ID, it will not be replaced.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addJar

      @Nonnull public JobConfig addJar(@Nonnull File file)
      Adds a JAR whose contents will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.

      This variant identifies the JAR with a File. The filename part of the path will be used as the resource ID - if there's already a resource with that ID, it will not be replaced.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addJar

      @Nonnull public JobConfig addJar(@Nonnull String path)
      Adds a JAR whose contents will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.

      This variant identifies the JAR with a path string. The filename part will be used as the resource ID - if there's already a resource with that ID, it will not be replaced.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addJarsInZip

      @Nonnull public JobConfig addJarsInZip(@Nonnull URL url)
      Adds a ZIP file with JARs whose contents will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. (An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.)

      This variant identifies the ZIP file with a URL, which must contain at least one path segment. The last path segment ("filename") will be used as the resource ID, so two ZIPs with the same filename will be in conflict.

      The ZIP file should contain only JARs. Any other files will be ignored.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • addJarsInZip

      @Nonnull public JobConfig addJarsInZip(@Nonnull File file)
      Adds a ZIP file with JARs whose contents will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. (An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.)

      This variant identifies the ZIP file with a File. The filename part will be used as the resource ID, so two ZIPs with the same filename will be in conflict.

      The ZIP file should contain only JARs. Any other files will be ignored.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • addJarsInZip

      @Nonnull public JobConfig addJarsInZip(@Nonnull String path)
      Adds a ZIP file with JARs whose contents will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. (An important example is the IMap data source, which can instantiate only the classes from the Jet instance's classpath.)

      This variant identifies the ZIP file with a path string. The filename part will be used as the resource ID, so two ZIPs with the same filename will be in conflict.

      The ZIP file should contain only JARs. Any other files will be ignored.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • addClasspathResource

      @Nonnull public JobConfig addClasspathResource(@Nonnull URL url)
      Adds a resource that will be available on the Jet job's classpath. All the code attached to the underlying pipeline or DAG will have access to it.

      This variant identifies the resource with a URL, which must contain at least one path segment. The last path segment ("filename") will be used as the resource ID, so two resources with the same filename will be in conflict.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addClasspathResource

      @Nonnull public JobConfig addClasspathResource(@Nonnull URL url, @Nonnull String id)
      Adds a resource that will be available on the Jet job's classpath. All the code attached to the underlying pipeline or DAG will have access to it. The supplied id becomes the path under which the resource is available from the class loader.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addClasspathResource

      @Nonnull public JobConfig addClasspathResource(@Nonnull File file)
      Adds a file that will be available as a resource on the Jet job's classpath. All the code attached to the underlying pipeline or DAG will have access to it. The file will reside in the root of the classpath, under its own filename. This means that two files with the same filename will be in conflict.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addClasspathResource

      @Nonnull public JobConfig addClasspathResource(@Nonnull File file, @Nonnull String id)
      Adds a file that will be available as a resource on the Jet job's classpath. All the code attached to the underlying pipeline or DAG will have access to it. The supplied id becomes the path under which the resource is available from the class loader.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addClasspathResource

      @Nonnull public JobConfig addClasspathResource(@Nonnull String path)
      Adds a file that will be available as a resource on the Jet job's classpath. All the code attached to the underlying pipeline or DAG will have access to it. It will reside in the root of the classpath, under its own filename. This means that two files with the same filename will be in conflict.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addClasspathResource

      @Nonnull public JobConfig addClasspathResource(@Nonnull String path, @Nonnull String id)
      Adds a file that will be available as a resource on the Jet job's classpath. All the code attached to the underlying pipeline or DAG will have access to it. The supplied id becomes the path under which the resource is available from the class loader.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • addCustomClasspath

      @Nonnull @Beta public JobConfig addCustomClasspath(@Nonnull String name, @Nonnull String path)
      Adds custom classpath element to a stage with the given name.
      
       BatchSource<String> source = ...
       JobConfig config = new JobConfig();
       config.addCustomClasspath(source.name(), "hazelcast-client-3.12.13.jar");
       
      Parameters:
      name - name of the stage, must be unique for the whole pipeline (the stage name can be set via Stage.setName(String))
      path - path to the jar relative to the `ext` directory
      Returns:
      this instance for fluent API
    • addCustomClasspaths

      @Nonnull @Beta public JobConfig addCustomClasspaths(@Nonnull String name, @Nonnull List<String> paths)
      Adds custom classpath elements to a stage with the given name.
      
       BatchSource<String> source = ...
       JobConfig config = new JobConfig();
       config.addCustomClasspaths(source.name(), jarList);
       
      Parameters:
      name - name of the stage, must be unique for the whole pipeline (the stage name can be set via Stage.setName(String))
      paths - paths to the jar relative to the `ext` directory
      Returns:
      this instance for fluent API
    • attachFile

      @Nonnull public JobConfig attachFile(@Nonnull URL url)
      Adds the file identified by the supplied URL as a resource that will be available to the job while it's executing in the Jet cluster. The resource's filename (the last path segment in the URL) becomes its ID, so two resources with the same filename will be in conflict.

      To retrieve the file from within the Jet job, call ctx.attachedFile(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). The file will have the same name as the one supplied here, but it will be in a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachFile

      @Nonnull public JobConfig attachFile(@Nonnull URL url, @Nonnull String id)
      Adds the file identified by the supplied URL to the list of resources that will be available to the job while it's executing in the Jet cluster. The file will be registered under the supplied ID.

      To retrieve the file from within the Jet job, call ctx.attachedFile(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). The file will have the same name as the one supplied here, but it will be in a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachFile

      @Nonnull public JobConfig attachFile(@Nonnull File file)
      Adds the supplied file to the list of resources that will be available to the job while it's executing in the Jet cluster. The filename becomes the ID of the file, so two files with the same name will be in conflict.

      To retrieve the file from within the Jet job, call ctx.attachedFile(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). The file will have the same name as the one supplied here, but it will be in a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachFile

      @Nonnull public JobConfig attachFile(@Nonnull File file, @Nonnull String id)
      Adds the supplied file to the list of files that will be available to the job while it's executing in the Jet cluster. The file will be registered under the supplied ID.

      To retrieve the file from within the Jet job, call ctx.attachedFile(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). The file will have the same name as the one supplied here, but it will be in a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachFile

      @Nonnull public JobConfig attachFile(@Nonnull String path)
      Adds the file identified by the supplied pathname to the list of files that will be available to the job while it's executing in the Jet cluster. The filename becomes the ID of the file, so two files with the same name will be in conflict.

      To retrieve the file from within the Jet job, call ctx.attachedFile(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). The file will have the same name as the one supplied here, but it will be in a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachFile

      @Nonnull public JobConfig attachFile(@Nonnull String path, @Nonnull String id)
      Adds the file identified by the supplied pathname to the list of files that will be available to the job while it's executing in the Jet cluster. The file will be registered under the supplied ID.

      To retrieve the file from within the Jet job, call ctx.attachedFile(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). The file will have the same name as the one supplied here, but it will be in a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachDirectory

      @Nonnull public JobConfig attachDirectory(@Nonnull URL url)
      Adds the directory identified by the supplied URL to the list of directories that will be available to the job while it's executing in the Jet cluster. Directory name (the last path segment in the URL) becomes its ID, so two directories with the same name will be in conflict. Hidden files are ignored.

      To retrieve the directory from within the Jet job, call ctx.attachedDirectory(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). It will be a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachDirectory

      @Nonnull public JobConfig attachDirectory(@Nonnull URL url, @Nonnull String id)
      Adds the directory identified by the supplied URL to the list of directories that will be available to the job while it's executing in the Jet cluster. The directory will be registered under the supplied ID. Hidden files are ignored.

      To retrieve the directory from within the Jet job, call ctx.attachedDirectory(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). It will be a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachDirectory

      @Nonnull public JobConfig attachDirectory(@Nonnull String path)
      Adds the directory identified by the supplied pathname to the list of files that will be available to the job while it's executing in the Jet cluster. The directory name (the last path segment) becomes its ID, so two directories with the same name will be in conflict. Hidden files are ignored.

      To retrieve the directory from within the Jet job, call ctx.attachedDirectory(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). It will be a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachDirectory

      @Nonnull public JobConfig attachDirectory(@Nonnull String path, @Nonnull String id)
      Adds the directory identified by the supplied pathname to the list of files that will be available to the job while it's executing in the Jet cluster. The directory will be registered under the supplied ID. Hidden files are ignored.

      To retrieve the directory from within the Jet job, call ctx.attachedDirectory(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). It will be a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachDirectory

      @Nonnull public JobConfig attachDirectory(@Nonnull File file)
      Adds the supplied directory to the list of files that will be available to the job while it's executing in the Jet cluster. The directory name (the last path segment) becomes its ID, so two directories with the same name will be in conflict. Hidden files are ignored.

      To retrieve the directory from within the Jet job, call ctx.attachedDirectory(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). It will be a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachDirectory

      @Nonnull public JobConfig attachDirectory(@Nonnull File file, @Nonnull String id)
      Adds the supplied directory to the list of files that will be available to the job while it's executing in the Jet cluster. The directory will be registered under the supplied ID. Hidden files are ignored.

      To retrieve the directory from within the Jet job, call ctx.attachedDirectory(id), where ctx is the ProcessorSupplier context available, for example, to ServiceFactory.createContextFn(). It will be a temporary directory on the Jet server.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
      Since:
      Jet 4.0
    • attachAll

      @Nonnull public JobConfig attachAll(@Nonnull Map<String,File> idToFile)
      Attaches all the files/directories in the supplied map, as if by calling attachDirectory(dir, id) for every entry that resolves to a directory and attachFile(file, id) for every entry that resolves to a regular file.

      Cannot be used for light jobs.

      Returns:
      this instance for fluent API
    • getResourceConfigs

      @Nonnull @PrivateApi public Map<String,ResourceConfig> getResourceConfigs()
      Returns all the registered resource configurations.
    • getCustomClassPaths

      public Map<String,List<String>> getCustomClassPaths()
      Returns configured custom classpath elements, See addCustomClasspath(String, String) and addCustomClasspaths(String, List)
    • registerSerializer

      @Nonnull @EvolvingApi public <T, S extends StreamSerializer<T>> JobConfig registerSerializer(@Nonnull Class<T> clazz, @Nonnull Class<S> serializerClass)
      Registers the given serializer for the given class for the scope of the job. It will be accessible to all the code attached to the underlying pipeline or DAG, but not to any other code. There are several serializer types you can register, see the <a href="https://jet-start.sh/docs/api/serialization#serialization-of-data-types Programming Guide.

      A serializer registered on the job level has precedence over any serializer registered on the cluster level.

      The serializer must have no-arg constructor.

      Cannot be used for light jobs.

      Parameters:
      clazz - class to register serializer for
      serializerClass - class of the serializer to be registered
      Returns:
      this instance for fluent API
      Since:
      Jet 4.1
    • getSerializerConfigs

      @Nonnull @PrivateApi public Map<String,String> getSerializerConfigs()
      Returns all the registered serializer configurations. This is a private API.
    • setArgument

      @Nonnull public JobConfig setArgument(String key, Object value)
      Associates the specified value with the specified key. The mapping will be available to the job while it's executing in the Jet cluster.
      Parameters:
      key - key with which the specified value is to be associated
      value - value to be associated with the specified key
      Returns:
      this instance for fluent API
      Since:
      5.0
    • getArgument

      @Nullable public <T> T getArgument(String key)
      Returns the value to which the specified key is mapped, or null if there is no mapping for the key.
      Parameters:
      key - the key whose associated value is to be returned
      Since:
      5.0
    • setClassLoaderFactory

      @Nonnull public JobConfig setClassLoaderFactory(@Nullable JobClassLoaderFactory classLoaderFactory)
      Sets a custom JobClassLoaderFactory that will be used to load job classes and resources on Jet members. Not supported for light jobs.

      NOTE: Defining a custom factory means that a User Code Namespace should not be defined using setUserCodeNamespace(String) as these features are incompatible and will result in an exception being thrown at Job creation if both are defined.

      Returns:
      this instance for fluent API
    • getClassLoaderFactory

      @Nullable public JobClassLoaderFactory getClassLoaderFactory()
      Returns the configured JobClassLoaderFactory.
    • getInitialSnapshotName

      @Nullable public String getInitialSnapshotName()
      Returns the configured initial snapshot name or null if no initial snapshot is configured.
    • setInitialSnapshotName

      @Nonnull public JobConfig setInitialSnapshotName(@Nullable String initialSnapshotName)
      Sets the exported state snapshot name to restore the initial job state from. This state will be used for initial state and also for the case when the execution restarts before it produces first snapshot.

      The job will use the state even if processing guarantee is set to ProcessingGuarantee.NONE.

      Cannot be used for light jobs.

      Parameters:
      initialSnapshotName - the snapshot name given to Job.exportSnapshot(String)
      Returns:
      this instance for fluent API
      Since:
      Jet 3.0
    • isMetricsEnabled

      public boolean isMetricsEnabled()
      Returns if metrics collection is enabled for the job.
      Since:
      Jet 3.2
    • setMetricsEnabled

      @Nonnull public JobConfig setMetricsEnabled(boolean enabled)
      Sets whether metrics collection should be enabled for the job. Needs BaseMetricsConfig.isEnabled() to be on in order to function.

      Metrics for running jobs can be queried using Job.getMetrics() It's enabled by default. Ignored for light jobs.

      Since:
      Jet 3.2
    • isStoreMetricsAfterJobCompletion

      public boolean isStoreMetricsAfterJobCompletion()
      Returns whether metrics should be stored in the cluster after the job completes successfully. Needs both BaseMetricsConfig.isEnabled() and isMetricsEnabled() to be on in order to function.

      If enabled, metrics can be retrieved by calling Job.getMetrics().

      It's disabled by default.

      Since:
      Jet 3.2
    • setStoreMetricsAfterJobCompletion

      public JobConfig setStoreMetricsAfterJobCompletion(boolean storeMetricsAfterJobCompletion)
      Sets whether metrics should be stored in the cluster after the job completes. If enabled, metrics can be retrieved for the configured job after it has completed successfully and is no longer running by calling Job.getMetrics().

      If disabled, once the configured job stops running Job.getMetrics() will always return empty metrics for it, regardless of the settings for global metrics collection or per job metrics collection.

      It's disabled by default. Ignored for light jobs.

      Since:
      Jet 3.2
    • getMaxProcessorAccumulatedRecords

      public long getMaxProcessorAccumulatedRecords()
      Returns the maximum number of records that can be accumulated by any single Processor instance in the context of the job.
      Since:
      5.0
    • setMaxProcessorAccumulatedRecords

      public JobConfig setMaxProcessorAccumulatedRecords(long maxProcessorAccumulatedRecords)
      Sets the maximum number of records that can be accumulated by any single Processor instance in the context of the job.

      For more info see JetConfig.setMaxProcessorAccumulatedRecords(long).

      If set, it has precedence over JetConfig's one.

      The default value is -1 - in that case JetConfig's value is used.

      Since:
      5.0
    • getTimeoutMillis

      public long getTimeoutMillis()
      Returns maximum execution time for the job in milliseconds.
      Since:
      5.0
    • setTimeoutMillis

      public JobConfig setTimeoutMillis(long timeoutMillis)
      Sets the maximum execution time for the job in milliseconds. If the execution time (counted from the time job is submitted), exceeds this value, the job is forcefully cancelled. The default value is 0, which denotes no time limit on the execution of the job.
      Since:
      5.0
    • getUserCodeNamespace

      @Nullable public String getUserCodeNamespace()
      Retrieves the User Code Namespace (UCN) to use with this job, if one has been set by calling setUserCodeNamespace(String). If a UCN is provided with a Jet job, then the job will have access to resources from the UCN during execution.
      Returns:
      the User Code Namespace associated with this job if it is configured, or null if one has not been set.
      Since:
      6.0
    • setUserCodeNamespace

      public void setUserCodeNamespace(String namespace)
      Sets the User Code Namespace (UCN) to use with this job. Setting this to null will clear the association of this job with a UCN. If a UCN is provided with a Jet job, then the job will have access to resources from the UCN during execution.
      Parameters:
      namespace - the User Code Namespace to use with this Jet job
      Since:
      6.0
    • getFactoryId

      public int getFactoryId()
      Description copied from interface: IdentifiedDataSerializable
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
      getFactoryId in interface IdentifiedDataSerializable
      Returns:
      factory ID
    • getClassId

      public int getClassId()
      Description copied from interface: IdentifiedDataSerializable
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
      getClassId in interface IdentifiedDataSerializable
      Returns:
      type ID
    • writeData

      public void writeData(ObjectDataOutput out) throws IOException
      Description copied from interface: DataSerializable
      Writes object fields to output stream
      Specified by:
      writeData in interface DataSerializable
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      public void readData(ObjectDataInput in) throws IOException
      Description copied from interface: DataSerializable
      Reads fields from the input stream
      Specified by:
      readData in interface DataSerializable
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • lock

      @PrivateApi public void lock()
      Used to prevent further mutations the config after submitting it with a job execution.

      It's not a public API, can be removed in the future.