New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement exclusive job execution #1203
Implement exclusive job execution #1203
Conversation
Test FAILed. |
Test FAILed. |
hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/AbstractJetInstance.java
Show resolved
Hide resolved
hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/AbstractJetInstance.java
Outdated
Show resolved
Hide resolved
hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/JobCoordinationService.java
Show resolved
Hide resolved
Test FAILed. |
Test PASSed. |
1 similar comment
Test PASSed. |
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breaking changes must also be documented
@@ -188,6 +189,14 @@ public Job newJob(@Nonnull DAG dag, @Nonnull JobConfig config) { | |||
return instance.newJob(dag, config); | |||
} | |||
|
|||
@Nonnull @Override | |||
public Job newJobIfAbsent(@Nonnull DAG dag, @Nonnull JobConfig config) { | |||
if (jarPathname != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated logic, should be extracted to method
* | ||
* <p>See also {@link #newJobIfAbsent}. | ||
* | ||
* @throws DuplicateActiveJobNameException if there is an active job with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe JobAlreadyExistsException
would be better?
* limitations under the License. | ||
*/ | ||
|
||
package com.hazelcast.jet.core; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be in core but in .jet
as it's a public facing exception
Test PASSed. |
There can be at most one active job (i.e., not completed/failed job) with the same name. Once a named job completes, its name can be reused.
2bf9616
to
3bac224
Compare
Test PASSed. |
Test PASSed. |
1 similar comment
Test PASSed. |
Test PASSed. |
There can be at most one active job (i.e., not completed/failed job)
with the same name. Once a named job completes, its name can be reused.
BREAKING CHANGE: When a new job with a duplicate name is submitted via
newJob()
, it throws an exception.