@PublicEvolving public class SavepointWriter extends Object
SavepointWriter
can create new savepoints from bounded data streams. This can allow for
boostrapping state for new applications or modifying the savepoints of existing jobs.Modifier and Type | Field and Description |
---|---|
protected SavepointMetadataV2 |
metadata
The savepoint metadata, which maintains the current set of existing / newly added operator
states.
|
protected StateBackend |
stateBackend
The state backend to use when writing this savepoint.
|
Modifier and Type | Method and Description |
---|---|
static SavepointWriter |
fromExistingSavepoint(String path)
Loads an existing savepoint.
|
static SavepointWriter |
fromExistingSavepoint(String path,
StateBackend stateBackend)
Loads an existing savepoint.
|
static SavepointWriter |
newSavepoint(int maxParallelism)
Creates a new savepoint.
|
static SavepointWriter |
newSavepoint(StateBackend stateBackend,
int maxParallelism)
Creates a new savepoint.
|
SavepointWriter |
removeOperator(String uid)
Drop an existing operator from the savepoint.
|
<T> SavepointWriter |
withConfiguration(ConfigOption<T> option,
T value)
Sets a configuration that will be applied to the stream operators used to bootstrap a new
savepoint.
|
<T> SavepointWriter |
withOperator(String uid,
StateBootstrapTransformation<T> transformation)
Adds a new operator to the savepoint.
|
void |
write(String path)
Write out a new or updated savepoint.
|
protected final SavepointMetadataV2 metadata
@Nullable protected final StateBackend stateBackend
public static SavepointWriter fromExistingSavepoint(String path) throws IOException
path
- The path to an existing savepoint on disk.SavepointWriter
.IOException
fromExistingSavepoint(String, StateBackend)
,
withConfiguration(ConfigOption, Object)
public static SavepointWriter fromExistingSavepoint(String path, StateBackend stateBackend) throws IOException
path
- The path to an existing savepoint on disk.stateBackend
- The state backend of the savepoint.SavepointWriter
.IOException
fromExistingSavepoint(String)
public static SavepointWriter newSavepoint(int maxParallelism)
maxParallelism
- The max parallelism of the savepoint.SavepointWriter
.newSavepoint(StateBackend, int)
,
withConfiguration(ConfigOption, Object)
public static SavepointWriter newSavepoint(StateBackend stateBackend, int maxParallelism)
stateBackend
- The state backend of the savepoint used for keyed state.maxParallelism
- The max parallelism of the savepoint.SavepointWriter
.newSavepoint(int)
public SavepointWriter removeOperator(String uid)
uid
- The uid of the operator.public <T> SavepointWriter withOperator(String uid, StateBootstrapTransformation<T> transformation)
uid
- The uid of the operator.transformation
- The operator to be included.public <T> SavepointWriter withConfiguration(ConfigOption<T> option, T value)
T
- type of the value to be storedoption
- metadata informationvalue
- value to be storedpublic final void write(String path)
path
- The path to where the savepoint should be written.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.