Interface JetService
- All Known Subinterfaces:
- JetInstance
- Since:
- 5.0
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionReturns the configuration for this Jet member.getJob(long jobId) Returns the job with the given id ornullif no such job could be found.default JobReturns the active or last submitted job with the given name ornullif no such job could be found.getJobs()Returns all submitted jobs.Returns all jobs submitted with the given name, ordered in descending order by submission time.getJobStateSnapshot(String name) Returns theJobStateSnapshotobject representing an exported snapshot with the given name.Returns the collection of exported job state snapshots stored in the cluster.<T> Observable<T>getObservable(String name) Returns anObservableinstance with the specified name.Collection<Observable<?>>Returns a list of all theObservablesthat are active.default JobCreates and returns a Jet job based on the supplied DAG.Creates and returns a Jet job based on the supplied DAG and job configuration.default JobCreates and returns an executable job based on the supplied pipeline.Creates and returns a Jet job based on the supplied pipeline and job configuration.newJobBuilder(DAG dag) Creates aJobBuilderfor a new Jet job withDAGdefinition.newJobBuilder(Pipeline pipeline) Creates aJobBuilderfor a new Jet job withPipelinedefinition.newJobIfAbsent(DAG dag, JobConfig config) Creates and returns a Jet job based on the supplied DAG and job configuration.newJobIfAbsent(Pipeline pipeline, JobConfig config) Creates and returns a Jet job based on the supplied pipeline and job configuration.default JobnewLightJob(DAG dag) Submits a job defined in the Core API with a default config.newLightJob(DAG dag, JobConfig config) Submits a job defined in the Core API.default JobnewLightJob(Pipeline pipeline) Submits a new light job with a default config.newLightJob(Pipeline pipeline, JobConfig config) Submits a light job for execution.default <T> Observable<T>Returns a new observable with a randomly generated name
- 
Method Details- 
getConfigReturns the configuration for this Jet member. This method is not available on client instances.
- 
newJobCreates and returns a Jet job based on the supplied DAG. Jet will asynchronously start executing the job.
- 
newJobCreates and returns an executable job based on the supplied pipeline. Jet will asynchronously start executing the job.
- 
newJobCreates and returns a Jet job based on the supplied DAG and job configuration. Jet will asynchronously start executing the job.If the name in the JobConfig is non-null, Jet checks if there is an active job with equal name, in which case it throws JobAlreadyExistsException. Job is active if it is running, suspended or waiting to be run; that is it has not completed or failed. Thus, there can be at most one active job with a given name at a time, and you can re-use the job name after the previous job completed.See also newJobIfAbsent(com.hazelcast.jet.core.DAG, com.hazelcast.jet.config.JobConfig).- Throws:
- JobAlreadyExistsException- if there is an active job with an equal name
 
- 
newJobCreates and returns a Jet job based on the supplied pipeline and job configuration. Jet will asynchronously start executing the job.If the name in the JobConfig is non-null, Jet checks if there is an active job with equal name, in which case it throws JobAlreadyExistsException. Job is active if it is running, suspended or waiting to be run; that is it has not completed or failed. Thus, there can be at most one active job with a given name at a time, and you can re-use the job name after the previous job completed.See also newJobIfAbsent(com.hazelcast.jet.core.DAG, com.hazelcast.jet.config.JobConfig).- Throws:
- JobAlreadyExistsException- if there is an active job with an equal name
 
- 
newJobIfAbsentCreates and returns a Jet job based on the supplied DAG and job configuration. Jet will asynchronously start executing the job.If the name in the JobConfig is non-null, Jet checks if there is an active job with equal name. If there is, it will join that job instead of submitting a new one. Job is active if it is running, suspended or waiting to be run; that is it has not completed or failed. In other words, this method ensures that the job with this name is running and is not running multiple times in parallel. This method is useful for microservices deployment when each package contains a jet member and the job, and you want the job to run only once. But if the job is a batch job and runs very quickly, it can happen that it executes multiple times, because the job name can be reused after a previous execution completed. If the job name is null, a new job is always submitted. See also newJob(com.hazelcast.jet.core.DAG).
- 
newJobIfAbsentCreates and returns a Jet job based on the supplied pipeline and job configuration. Jet will asynchronously start executing the job.If the name in the JobConfig is non-null, Jet checks if there is an active job with equal name. If there is, it will join that job instead of submitting a new one. Job is active if it is running, suspended or waiting to be run; that is it has not completed or failed. In other words, this method ensures that the job with this name is running and is not running multiple times in parallel. This method is useful for microservices deployment when each package contains a jet member and the job, and you want the job to run only once. But if the job is a batch job and runs very quickly, it can happen that it executes multiple times, because the job name can be reused after a previous execution completed. If the job name is null, a new job is always submitted. See also newJob(com.hazelcast.jet.core.DAG).
- 
newLightJobSubmits a new light job with a default config. SeenewLightJob(Pipeline, JobConfig).
- 
newLightJobSubmits a light job for execution. This kind of job is focused on reducing the job startup and teardown time: only a single operation is used to deploy the job instead of 2 for normal jobs.Limitations of light jobs: - very limited job configuration: no processing guarantee, no custom
         classes or job resources - all job code must be available in the cluster.
         Refer to JobConfigfor details.
- metrics not available through Job.getMetrics(). However, light jobs are included in member metrics accessed through other means.
- failures will be only reported to the caller and logged in the cluster logs, but no trace of the job will remain in the cluster after it's done
- RestartableExceptiondoesn't restart the job, but it will fail
 It substantially reduces the overhead for jobs that take milliseconds to complete. A light job will not be cancelled if the client disconnects. Its potential failure will be only logged in member logs. You should not mutate the JobConfigorPipelineinstances after submitting them to this method.
- very limited job configuration: no processing guarantee, no custom
         classes or job resources - all job code must be available in the cluster.
         Refer to 
- 
newLightJobSubmits a job defined in the Core API with a default config.See newLightJob(Pipeline, JobConfig)for more information.
- 
newLightJobSubmits a job defined in the Core API.See newLightJob(Pipeline, JobConfig)for more information.
- 
getJobsReturns all submitted jobs. The result includes completed normal jobs, but doesn't include completed light jobs - for light jobs the cluster doesn't retain any information after they complete.
- 
getJobReturns the job with the given id ornullif no such job could be found.
- 
getJobsReturns all jobs submitted with the given name, ordered in descending order by submission time. The active job is always first. Empty list will be returned if no job with the given name exists. The list includes completed jobs.
- 
getJobReturns the active or last submitted job with the given name ornullif no such job could be found. The returned job can be already completed.
- 
getJobStateSnapshotReturns theJobStateSnapshotobject representing an exported snapshot with the given name. Returnsnullif no such snapshot exists.
- 
getJobStateSnapshotsReturns the collection of exported job state snapshots stored in the cluster.
- 
getObservableReturns anObservableinstance with the specified name. Represents a flowing sequence of events produced by jobs containing observable sinks.Multiple calls of this method with the same name return the same instance (unless it was destroyed in the meantime). In order to observe the events register an Observeron theObservable.- Parameters:
- name- name of the observable
- Returns:
- observable with the specified name
- Since:
- Jet 4.0
 
- 
newObservableReturns a new observable with a randomly generated name- Since:
- Jet 4.0
 
- 
getObservablesReturns a list of all theObservablesthat are active. By "active" we mean that their backingRingbufferhas been created, which happens when either their firstObserveris registered or when the job publishing their data (via observable sinks) starts executing.- Since:
- Jet 4.0
 
- 
newJobBuilderCreates aJobBuilderfor a new Jet job withDAGdefinition.- Since:
- 5.5
 
- 
newJobBuilderCreates aJobBuilderfor a new Jet job withPipelinedefinition.- Since:
- 5.5
 
 
-