You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "Zouxxyy (via GitHub)" <gi...@apache.org> on 2023/07/21 03:42:48 UTC

[GitHub] [hudi] Zouxxyy commented on a diff in pull request #9247: [HUDI-6546] Set AutoAdjustLockConfigs for flink writer config

Zouxxyy commented on code in PR #9247:
URL: https://github.com/apache/hudi/pull/9247#discussion_r1270196076


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/utils/TestFlinkWriteClients.java:
##########
@@ -55,7 +57,19 @@ void testAutoSetupLockProvider() throws Exception {
     conf.setBoolean(FlinkOptions.METADATA_ENABLED, true);
     StreamerUtil.initTableIfNotExists(conf);
     HoodieWriteConfig writeConfig = FlinkWriteClients.getHoodieClientConfig(conf, false, false);
-    assertThat(writeConfig.getLockProviderClass(), is(FileSystemBasedLockProvider.class.getName()));
+    Assertions.assertTrue(writeConfig.isLockRequired());
+    assertThat(writeConfig.getLockProviderClass(), is(InProcessLockProvider.class.getName()));
+    assertThat(writeConfig.getWriteConcurrencyMode(), is(WriteConcurrencyMode.SINGLE_WRITER));
+  }
+
+  @Test
+  void testAutoSetupLockProviderWithoutTableService() throws Exception {
+    conf.setBoolean(FlinkOptions.METADATA_ENABLED, true);
+    conf.setBoolean("hoodie.table.services.enabled", false);
+    StreamerUtil.initTableIfNotExists(conf);

Review Comment:
   Can you explain why it doesn't work well?



##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/utils/TestFlinkWriteClients.java:
##########
@@ -55,7 +57,19 @@ void testAutoSetupLockProvider() throws Exception {
     conf.setBoolean(FlinkOptions.METADATA_ENABLED, true);
     StreamerUtil.initTableIfNotExists(conf);
     HoodieWriteConfig writeConfig = FlinkWriteClients.getHoodieClientConfig(conf, false, false);
-    assertThat(writeConfig.getLockProviderClass(), is(FileSystemBasedLockProvider.class.getName()));
+    Assertions.assertTrue(writeConfig.isLockRequired());
+    assertThat(writeConfig.getLockProviderClass(), is(InProcessLockProvider.class.getName()));
+    assertThat(writeConfig.getWriteConcurrencyMode(), is(WriteConcurrencyMode.SINGLE_WRITER));
+  }
+
+  @Test
+  void testAutoSetupLockProviderWithoutTableService() throws Exception {
+    conf.setBoolean(FlinkOptions.METADATA_ENABLED, true);
+    conf.setBoolean("hoodie.table.services.enabled", false);
+    StreamerUtil.initTableIfNotExists(conf);

Review Comment:
   Can you explain why it doesn't work well with flink?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org