@Public public class CheckpointConfig extends Object implements Serializable
限定符和类型 | 类和说明 |
---|---|
static class |
CheckpointConfig.ExternalizedCheckpointCleanup
Cleanup behaviour for externalized checkpoints when the job is cancelled.
|
限定符和类型 | 字段和说明 |
---|---|
static int |
DEFAULT_MAX_CONCURRENT_CHECKPOINTS
The default limit of concurrently happening checkpoints: one.
|
static long |
DEFAULT_MIN_PAUSE_BETWEEN_CHECKPOINTS
The default minimum pause to be made between checkpoints: none.
|
static CheckpointingMode |
DEFAULT_MODE
The default checkpoint mode: exactly once.
|
static long |
DEFAULT_TIMEOUT
The default timeout of a checkpoint attempt: 10 minutes.
|
构造器和说明 |
---|
CheckpointConfig() |
限定符和类型 | 方法和说明 |
---|---|
void |
enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup cleanupMode)
Enables checkpoints to be persisted externally.
|
CheckpointingMode |
getCheckpointingMode()
Gets the checkpointing mode (exactly-once vs. at-least-once).
|
long |
getCheckpointInterval()
Gets the interval in which checkpoints are periodically scheduled.
|
long |
getCheckpointTimeout()
Gets the maximum time that a checkpoint may take before being discarded.
|
CheckpointConfig.ExternalizedCheckpointCleanup |
getExternalizedCheckpointCleanup()
Returns the cleanup behaviour for externalized checkpoints.
|
int |
getMaxConcurrentCheckpoints()
Gets the maximum number of checkpoint attempts that may be in progress at the same time.
|
long |
getMinPauseBetweenCheckpoints()
Gets the minimal pause between checkpointing attempts.
|
boolean |
isCheckpointingEnabled()
Checks whether checkpointing is enabled.
|
boolean |
isExternalizedCheckpointsEnabled()
Returns whether checkpoints should be persisted externally.
|
boolean |
isFailOnCheckpointingErrors()
This determines the behaviour of tasks if there is an error in their local checkpointing.
|
boolean |
isForceCheckpointing()
已过时。
This will be removed once iterations properly participate in checkpointing.
|
void |
setCheckpointingMode(CheckpointingMode checkpointingMode)
Sets the checkpointing mode (exactly-once vs. at-least-once).
|
void |
setCheckpointInterval(long checkpointInterval)
Sets the interval in which checkpoints are periodically scheduled.
|
void |
setCheckpointTimeout(long checkpointTimeout)
Sets the maximum time that a checkpoint may take before being discarded.
|
void |
setFailOnCheckpointingErrors(boolean failOnCheckpointingErrors)
Sets the expected behaviour for tasks in case that they encounter an error in their checkpointing procedure.
|
void |
setForceCheckpointing(boolean forceCheckpointing)
已过时。
This will be removed once iterations properly participate in checkpointing.
|
void |
setMaxConcurrentCheckpoints(int maxConcurrentCheckpoints)
Sets the maximum number of checkpoint attempts that may be in progress at the same time.
|
void |
setMinPauseBetweenCheckpoints(long minPauseBetweenCheckpoints)
Sets the minimal pause between checkpointing attempts.
|
public static final CheckpointingMode DEFAULT_MODE
public static final long DEFAULT_TIMEOUT
public static final long DEFAULT_MIN_PAUSE_BETWEEN_CHECKPOINTS
public static final int DEFAULT_MAX_CONCURRENT_CHECKPOINTS
public boolean isCheckpointingEnabled()
public CheckpointingMode getCheckpointingMode()
public void setCheckpointingMode(CheckpointingMode checkpointingMode)
checkpointingMode
- The checkpointing mode.public long getCheckpointInterval()
This setting defines the base interval. Checkpoint triggering may be delayed by the settings
getMaxConcurrentCheckpoints()
and getMinPauseBetweenCheckpoints()
.
public void setCheckpointInterval(long checkpointInterval)
This setting defines the base interval. Checkpoint triggering may be delayed by the settings
setMaxConcurrentCheckpoints(int)
and setMinPauseBetweenCheckpoints(long)
.
checkpointInterval
- The checkpoint interval, in milliseconds.public long getCheckpointTimeout()
public void setCheckpointTimeout(long checkpointTimeout)
checkpointTimeout
- The checkpoint timeout, in milliseconds.public long getMinPauseBetweenCheckpoints()
getMaxConcurrentCheckpoints()
).public void setMinPauseBetweenCheckpoints(long minPauseBetweenCheckpoints)
setMaxConcurrentCheckpoints(int)
).
If the maximum number of concurrent checkpoints is set to one, this setting makes effectively sure that a minimum amount of time passes where no checkpoint is in progress at all.
minPauseBetweenCheckpoints
- The minimal pause before the next checkpoint is triggered.public int getMaxConcurrentCheckpoints()
public void setMaxConcurrentCheckpoints(int maxConcurrentCheckpoints)
maxConcurrentCheckpoints
- The maximum number of concurrent checkpoint attempts.@Deprecated @PublicEvolving public boolean isForceCheckpointing()
@Deprecated @PublicEvolving public void setForceCheckpointing(boolean forceCheckpointing)
forceCheckpointing
- The flag to force checkpointing.public boolean isFailOnCheckpointingErrors()
public void setFailOnCheckpointingErrors(boolean failOnCheckpointingErrors)
@PublicEvolving public void enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup cleanupMode)
Externalized checkpoints write their meta data out to persistent
storage and are not automatically cleaned up when
the owning job fails or is suspended (terminating with job status
JobStatus.FAILED
or JobStatus.SUSPENDED
). In this
case, you have to manually clean up the checkpoint state, both
the meta data and actual program state.
The CheckpointConfig.ExternalizedCheckpointCleanup
mode defines how an
externalized checkpoint should be cleaned up on job cancellation. If you
choose to retain externalized checkpoints on cancellation you have you
handle checkpoint clean up manually when you cancel the job as well
(terminating with job status JobStatus.CANCELED
).
The target directory for externalized checkpoints is configured
via CheckpointingOptions.CHECKPOINTS_DIRECTORY
.
cleanupMode
- Externalized checkpoint cleanup behaviour.@PublicEvolving public boolean isExternalizedCheckpointsEnabled()
true
if checkpoints should be externalized.@PublicEvolving public CheckpointConfig.ExternalizedCheckpointCleanup getExternalizedCheckpointCleanup()
null
if none is configured.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.