public enum ProcessingGuarantee extends Enum<ProcessingGuarantee>
When AT_LEAST_ONCE
or EXACTLY_ONCE
is set, distributed
snapshotting will be enabled for the job. The distributed snapshot algorithm
works by sending barriers down the stream which upon receiving causes
the processors to save their state as a snapshot. Snapshots are saved
in memory and replicated across the cluster.
Since a processor can have multiple inputs, it must wait until the barrier is
received from all inputs before taking a snapshot. The difference between
AT_LEAST_ONCE
and EXACTLY_ONCE
is that in
AT_LEAST_ONCE
mode the processor can continue to process items
from inputs which have already received the barrier. This will result
in lower latency and higher throughput overall, with the caveat that
some items may be processed twice after a restart.
Enum Constant and Description |
---|
AT_LEAST_ONCE
Enables at-least-once processing semantics.
|
EXACTLY_ONCE
Enables exactly-once processing semantics.
|
NONE
No processing guarantees are given and no snapshots are taken during
job execution.
|
Modifier and Type | Method and Description |
---|---|
static ProcessingGuarantee |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ProcessingGuarantee[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ProcessingGuarantee NONE
This option provides the overall best throughput and latency and no storage overheads from snapshotting. However, it doesn't provide any correctness guarantees under failure.
public static final ProcessingGuarantee AT_LEAST_ONCE
This option requires in-memory snapshotting which will cause additional storage
requirements and overhead compared to NONE
. However it provides better
latency than EXACTLY_ONCE
with weaker guarantees.
public static final ProcessingGuarantee EXACTLY_ONCE
This option requires in-memory snapshotting which will cause additional storage
requirements and overhead compared to NONE
. It provides the strongest
correctness guarantee. However latency might increase due to the aligning of
barriers which are required in this processing mode.
public static ProcessingGuarantee[] values()
for (ProcessingGuarantee c : ProcessingGuarantee.values()) System.out.println(c);
public static ProcessingGuarantee valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2023 Hazelcast, Inc.. All rights reserved.