Skip to content

Commit 9224cdc

Browse files
committed
refine doc
1 parent b0a754a commit 9224cdc

File tree

6 files changed

+33
-65
lines changed

6 files changed

+33
-65
lines changed

fluss-client/src/test/java/org/apache/fluss/client/table/LakeEnableTableITCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void testCannotEnableTableWhenTableFormatDiffersFromClusterFormat() throws Excep
230230
@Test
231231
void testEnableTableAfterClusterEnablesDataLake() throws Exception {
232232
String databaseName = "test_db";
233-
String tableName = "test_table_before_cluster_enable";
233+
String tableName = "test_enable_datalake_table";
234234
TablePath tablePath = TablePath.of(databaseName, tableName);
235235

236236
admin.createDatabase(databaseName, DatabaseDescriptor.EMPTY, true).get();

fluss-server/src/main/java/org/apache/fluss/server/coordinator/LakeCatalogDynamicLoader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ public void validate(Configuration newConfig) throws ConfigException {
7575
// set, rather than only the merged result. We accept this for now because
7676
// table-level enablement is still validated, and enabling datalake for a table
7777
// will fail if datalake.format is not configured.
78-
boolean explicitDataLakeEnabled = newConfig.getOptional(DATALAKE_ENABLED).orElse(false);
79-
if (explicitDataLakeEnabled && newDatalakeFormat == null) {
78+
Optional<Boolean> optDataLakeEnabled = newConfig.getOptional(DATALAKE_ENABLED);
79+
if (optDataLakeEnabled.isPresent()
80+
&& optDataLakeEnabled.get()
81+
&& newDatalakeFormat == null) {
8082
throw new ConfigException(
8183
String.format(
8284
"'%s' must be configured when '%s' is explicitly set.",

fluss-server/src/main/java/org/apache/fluss/server/utils/TableDescriptorValidation.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,17 @@ public static void validateTableDescriptor(
129129

130130
private static void checkTableLakeFormatMatchesCluster(
131131
Configuration tableConf, @Nullable DataLakeFormat clusterDataLakeFormat) {
132+
if (clusterDataLakeFormat == null) {
133+
return;
134+
}
135+
136+
if (!tableConf.get(ConfigOptions.TABLE_DATALAKE_ENABLED)) {
137+
return;
138+
}
139+
132140
Optional<DataLakeFormat> tableDataLakeFormat =
133141
tableConf.getOptional(ConfigOptions.TABLE_DATALAKE_FORMAT);
134-
if (clusterDataLakeFormat != null
135-
&& tableDataLakeFormat.isPresent()
136-
&& tableDataLakeFormat.get() != clusterDataLakeFormat) {
142+
if (tableDataLakeFormat.isPresent() && tableDataLakeFormat.get() != clusterDataLakeFormat) {
137143
throw new InvalidConfigException(
138144
String.format(
139145
"'%s' ('%s') must match cluster '%s' ('%s') when '%s' is enabled.",

fluss-server/src/test/java/org/apache/fluss/server/DynamicConfigChangeTest.java

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public void reconfigure(Configuration newConfig) {
531531
}
532532

533533
@Test
534-
void testExplicitDatalakeEnabledRequiresFormat() throws Exception {
534+
void testExplicitDataLakeEnabledRequiresDataLakeFormat() throws Exception {
535535
try (LakeCatalogDynamicLoader lakeCatalogDynamicLoader =
536536
new LakeCatalogDynamicLoader(new Configuration(), null, true)) {
537537
DynamicConfigManager dynamicConfigManager =
@@ -552,41 +552,4 @@ void testExplicitDatalakeEnabledRequiresFormat() throws Exception {
552552
"'datalake.format' must be configured when 'datalake.enabled' is explicitly set.");
553553
}
554554
}
555-
556-
@Test
557-
void testPreBindOnlyModeDoesNotCreateLakeCatalog() throws Exception {
558-
try (LakeCatalogDynamicLoader lakeCatalogDynamicLoader =
559-
new LakeCatalogDynamicLoader(new Configuration(), null, true)) {
560-
DynamicConfigManager dynamicConfigManager =
561-
new DynamicConfigManager(zookeeperClient, new Configuration(), true);
562-
dynamicConfigManager.register(lakeCatalogDynamicLoader);
563-
dynamicConfigManager.startup();
564-
565-
dynamicConfigManager.alterConfigs(
566-
Arrays.asList(
567-
new AlterConfig(DATALAKE_FORMAT.key(), "paimon", AlterConfigOpType.SET),
568-
new AlterConfig(DATALAKE_ENABLED.key(), "false", AlterConfigOpType.SET),
569-
new AlterConfig(
570-
"datalake.paimon.metastore",
571-
"filesystem",
572-
AlterConfigOpType.SET)));
573-
574-
assertThat(lakeCatalogDynamicLoader.getLakeCatalogContainer().getDataLakeFormat())
575-
.isEqualTo(PAIMON);
576-
assertThat(
577-
lakeCatalogDynamicLoader
578-
.getLakeCatalogContainer()
579-
.isClusterDataLakeTableEnabled())
580-
.isFalse();
581-
assertThat(lakeCatalogDynamicLoader.getLakeCatalogContainer().getLakeCatalog())
582-
.isNull();
583-
assertThat(
584-
lakeCatalogDynamicLoader
585-
.getLakeCatalogContainer()
586-
.getDefaultTableLakeOptions())
587-
.isEqualTo(
588-
Collections.singletonMap(
589-
"table.datalake.paimon.metastore", "filesystem"));
590-
}
591-
}
592555
}

website/docs/maintenance/operations/updating-configs.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,10 @@ admin.alterClusterConfigs(
3232
new AlterConfig(DATALAKE_ENABLED.key(), "true", AlterConfigOpType.SET),
3333
new AlterConfig(DATALAKE_FORMAT.key(), "paimon", AlterConfigOpType.SET)));
3434

35-
// Pre-bind the lakehouse format without enabling lakehouse tables
36-
admin.alterClusterConfigs(
37-
Arrays.asList(
38-
new AlterConfig(DATALAKE_ENABLED.key(), "false", AlterConfigOpType.SET),
39-
new AlterConfig(DATALAKE_FORMAT.key(), "paimon", AlterConfigOpType.SET)));
40-
41-
// Return to legacy behavior where configuring datalake.format alone also enables lakehouse tables
35+
// Disable lakehouse storage
4236
admin.alterClusterConfigs(
4337
Collections.singletonList(
44-
new AlterConfig(DATALAKE_ENABLED.key(), null, AlterConfigOpType.DELETE)));
38+
new AlterConfig(DATALAKE_ENABLED.key(), "false", AlterConfigOpType.SET)));
4539

4640
// Set RocksDB shared rate limiter to 200MB/sec
4741
admin.alterClusterConfigs(
@@ -54,8 +48,6 @@ The `AlterConfig` class contains three properties:
5448
* `value`: The configuration value to be set (e.g., `paimon`)
5549
* `opType`: The operation type, either `AlterConfigOpType.SET` or `AlterConfigOpType.DELETE`
5650

57-
If `datalake.enabled` is explicitly configured, `datalake.format` must also be configured in the cluster.
58-
5951
### Using Flink Stored Procedures
6052

6153
For certain configurations, Fluss provides convenient Flink stored procedures that can be called directly from Flink SQL. See [Procedures](engine-flink/procedures.md#cluster-configuration-procedures) for detailed documentation on using `get_cluster_config` and `set_cluster_config` procedures.

website/docs/maintenance/operations/upgrade-notes-0.10.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,40 @@ sidebar_position: 4
55

66
# Upgrade Notes from v0.9 to v0.10
77

8-
## New `datalake.enabled` Cluster Configuration
8+
## Cluster Configuration Changes
99

10-
Starting from v0.10, Fluss introduces the cluster-level configuration `datalake.enabled` to control whether the cluster is ready to create and manage lakehouse tables.
10+
### New `datalake.enabled` Cluster Configuration
1111

12-
### Behavior Changes
12+
Starting in v0.10, Fluss introduces the cluster-level configuration `datalake.enabled` to control whether the cluster is ready to create and manage lakehouse tables.
1313

14-
- If `datalake.enabled` is unset, Fluss keeps the legacy behavior: configuring `datalake.format` alone also enables lakehouse tables.
15-
- If `datalake.enabled = false`, Fluss only pre-binds the lake format for newly created tables and does not allow lakehouse tables yet.
14+
#### Behavior Changes
15+
16+
- If `datalake.enabled` is unset, Fluss preserves the legacy behavior: configuring `datalake.format` alone also enables lakehouse tables.
17+
- If `datalake.enabled = false`, Fluss pre-binds the lake format for newly created tables but does not allow lakehouse tables yet.
1618
- If `datalake.enabled = true`, Fluss fully enables lakehouse tables.
1719
- If `datalake.enabled` is explicitly configured, `datalake.format` must also be configured.
1820

19-
### Recommended Configuration
21+
#### Recommended Configuration
2022

21-
If you want to enable lakehouse tables on the cluster, configure both options together:
23+
To enable lakehouse tables for the cluster, configure both options together:
2224

2325
```yaml
2426
datalake.enabled: true
2527
datalake.format: paimon
2628
```
2729
28-
If you only want to pre-bind the lake format without enabling lakehouse tables yet, configure:
30+
To pre-bind the lake format without enabling lakehouse tables yet, configure:
2931
3032
```yaml
3133
datalake.enabled: false
3234
datalake.format: paimon
3335
```
3436
35-
### Documentation Updates for Existing Deployments
37+
This mode is useful when you want newly created tables to carry the lake format in advance, while postponing lakehouse enablement at the cluster level.
38+
After `datalake.enabled` is later set to `true`, tables created under this configuration can still turn on `table.datalake.enabled` without being recreated.
39+
40+
#### Notes for Existing Deployments
3641

37-
If your existing deployment or internal scripts only set `datalake.format`, they will continue to work with the legacy behavior as long as `datalake.enabled` is left unset.
42+
If your existing deployment or internal scripts only set `datalake.format`, they will continue to work with the legacy behavior as long as `datalake.enabled` remains unset.
3843

39-
However, for new configuration examples and operational guidance, prefer configuring `datalake.enabled` explicitly together with `datalake.format`.
44+
For new configuration examples and operational guidance, we recommend explicitly configuring `datalake.enabled` together with `datalake.format`.

0 commit comments

Comments
 (0)