forked from apache/flink
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-21357][runtime/statebackend]Periodic materialization for gener…
…alized incremental checkpoints (apache#16606) * [hotfix][state] Introduce ChangelogOptions and backend materialization related configurations * [hotfix][state] Fix log4j2-test.properties for flink-statebackend-changelog * [hotfix][runtime] Move AsyncExceptionHandler from flink-streaming-java to flink-runtime * [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints * [do not commit][for testing only] * fixup! [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints Remove waiting for termination of periodicExecutor * fixup! [hotfix][state] Introduce ChangelogOptions and backend materialization related configurations Remove changelog_configuration.html * fixup! [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints close periodicMaterializationManager properly * fixup! [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints add synchronized access to periodicExecutor in PeriodicMaterializationManager * fixup! [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints make the semantics of allowedNumberOfFailures consistent * fixup! [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints Remove Test Code * fixup! [hotfix][state] Introduce ChangelogOptions and backend materialization related configurations add filesystem for STATE_CHANGE_LOG_STORAGE config description * fixup! [FLINK-21357][state] Periodic materialization for generalized incremental checkpoints several minior fixes * fixup! [hotfix][state] Introduce ChangelogOptions and backend materialization related configurations compiling the docs * fixup! [do not commit][for testing only] reset random flag of changelog
- Loading branch information
Showing
42 changed files
with
1,091 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
docs/layouts/shortcodes/generated/state_backend_changelog_section.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<table class="configuration table table-bordered"> | ||
<thead> | ||
<tr> | ||
<th class="text-left" style="width: 20%">Key</th> | ||
<th class="text-left" style="width: 15%">Default</th> | ||
<th class="text-left" style="width: 10%">Type</th> | ||
<th class="text-left" style="width: 55%">Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><h5>state.backend.changelog.enabled</h5></td> | ||
<td style="word-wrap: break-word;">false</td> | ||
<td>Boolean</td> | ||
<td>Whether to enable state backend to write state changes to StateChangelog. If this config is not set explicitly, it means no preference for enabling the change log, and the value in lower config level will take effect. The default value 'false' here means if no value set (job or cluster), the change log will not be enabled.</td> | ||
</tr> | ||
<tr> | ||
<td><h5>state.backend.changelog.max-failures-allowed</h5></td> | ||
<td style="word-wrap: break-word;">3</td> | ||
<td>Integer</td> | ||
<td>Max number of consecutive materialization failures allowed.</td> | ||
</tr> | ||
<tr> | ||
<td><h5>state.backend.changelog.periodic-materialize.interval</h5></td> | ||
<td style="word-wrap: break-word;">10 min</td> | ||
<td>Duration</td> | ||
<td>Defines the interval in milliseconds to perform periodic materialization for state backend.</td> | ||
</tr> | ||
<tr> | ||
<td><h5>state.backend.changelog.storage</h5></td> | ||
<td style="word-wrap: break-word;">"memory"</td> | ||
<td>String</td> | ||
<td>The storage to be used to store state changelog.<br />The implementation can be specified via their shortcut name.<br />The list of recognized shortcut names currently includes 'memory' and 'filesystem'.</td> | ||
</tr> | ||
</tbody> | ||
</table> |
36 changes: 36 additions & 0 deletions
36
docs/layouts/shortcodes/generated/state_changelog_configuration.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<table class="configuration table table-bordered"> | ||
<thead> | ||
<tr> | ||
<th class="text-left" style="width: 20%">Key</th> | ||
<th class="text-left" style="width: 15%">Default</th> | ||
<th class="text-left" style="width: 10%">Type</th> | ||
<th class="text-left" style="width: 55%">Description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><h5>state.backend.changelog.enabled</h5></td> | ||
<td style="word-wrap: break-word;">false</td> | ||
<td>Boolean</td> | ||
<td>Whether to enable state backend to write state changes to StateChangelog. If this config is not set explicitly, it means no preference for enabling the change log, and the value in lower config level will take effect. The default value 'false' here means if no value set (job or cluster), the change log will not be enabled.</td> | ||
</tr> | ||
<tr> | ||
<td><h5>state.backend.changelog.max-failures-allowed</h5></td> | ||
<td style="word-wrap: break-word;">3</td> | ||
<td>Integer</td> | ||
<td>Max number of consecutive materialization failures allowed.</td> | ||
</tr> | ||
<tr> | ||
<td><h5>state.backend.changelog.periodic-materialize.interval</h5></td> | ||
<td style="word-wrap: break-word;">10 min</td> | ||
<td>Duration</td> | ||
<td>Defines the interval in milliseconds to perform periodic materialization for state backend.</td> | ||
</tr> | ||
<tr> | ||
<td><h5>state.backend.changelog.storage</h5></td> | ||
<td style="word-wrap: break-word;">"memory"</td> | ||
<td>String</td> | ||
<td>The storage to be used to store state changelog.<br />The implementation can be specified via their shortcut name.<br />The list of recognized shortcut names currently includes 'memory' and 'filesystem'.</td> | ||
</tr> | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
flink-core/src/main/java/org/apache/flink/configuration/StateChangelogOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.flink.configuration; | ||
|
||
import org.apache.flink.annotation.PublicEvolving; | ||
import org.apache.flink.annotation.docs.Documentation; | ||
import org.apache.flink.configuration.description.Description; | ||
|
||
import java.time.Duration; | ||
|
||
/** A collection of all configuration options that relate to changelog. */ | ||
@PublicEvolving | ||
public class StateChangelogOptions { | ||
|
||
@Documentation.Section(Documentation.Sections.STATE_BACKEND_CHANGELOG) | ||
public static final ConfigOption<Duration> PERIODIC_MATERIALIZATION_INTERVAL = | ||
ConfigOptions.key("state.backend.changelog.periodic-materialize.interval") | ||
.durationType() | ||
.defaultValue(Duration.ofMinutes(10)) | ||
.withDescription( | ||
"Defines the interval in milliseconds to perform " | ||
+ "periodic materialization for state backend."); | ||
|
||
@Documentation.Section(Documentation.Sections.STATE_BACKEND_CHANGELOG) | ||
public static final ConfigOption<Integer> MATERIALIZATION_MAX_FAILURES_ALLOWED = | ||
ConfigOptions.key("state.backend.changelog.max-failures-allowed") | ||
.intType() | ||
.defaultValue(3) | ||
.withDescription("Max number of consecutive materialization failures allowed."); | ||
|
||
/** Whether to enable state change log. */ | ||
@Documentation.Section(value = Documentation.Sections.STATE_BACKEND_CHANGELOG) | ||
public static final ConfigOption<Boolean> ENABLE_STATE_CHANGE_LOG = | ||
ConfigOptions.key("state.backend.changelog.enabled") | ||
.booleanType() | ||
.defaultValue(false) | ||
.withDescription( | ||
"Whether to enable state backend to write state changes to StateChangelog. " | ||
+ "If this config is not set explicitly, it means no preference " | ||
+ "for enabling the change log, and the value in lower config " | ||
+ "level will take effect. The default value 'false' here means " | ||
+ "if no value set (job or cluster), the change log will not be " | ||
+ "enabled."); | ||
|
||
/** | ||
* Which storage to use to store state changelog. | ||
* | ||
* <p>Recognized shortcut name is 'memory' from {@code | ||
* InMemoryStateChangelogStorageFactory.getIdentifier()}, which is also the default value. | ||
*/ | ||
@Documentation.Section(value = Documentation.Sections.STATE_BACKEND_CHANGELOG) | ||
public static final ConfigOption<String> STATE_CHANGE_LOG_STORAGE = | ||
ConfigOptions.key("state.backend.changelog.storage") | ||
.stringType() | ||
.defaultValue("memory") | ||
.withDescription( | ||
Description.builder() | ||
.text("The storage to be used to store state changelog.") | ||
.linebreak() | ||
.text( | ||
"The implementation can be specified via their" | ||
+ " shortcut name.") | ||
.linebreak() | ||
.text( | ||
"The list of recognized shortcut names currently includes" | ||
+ " 'memory' and 'filesystem'.") | ||
.build()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.