[GitHub] [hudi] danny0405 commented on a diff in pull request #9330: [HUDI-6622] Reuse the table config from HoodieTableMetaClient in the …

2023-08-02 Thread via GitHub


danny0405 commented on code in PR #9330:
URL: https://github.com/apache/hudi/pull/9330#discussion_r1282663938


##
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableMetaClient.java:
##
@@ -690,7 +690,7 @@ private static HoodieTableMetaClient 
newMetaClient(Configuration conf, String ba
 ? (HoodieTableMetaClient) 
ReflectionUtils.loadClass("org.apache.hudi.common.table.HoodieTableMetaserverClient",
 new Class[]{Configuration.class, String.class, 
ConsistencyGuardConfig.class, String.class, FileSystemRetryConfig.class, 
String.class, String.class, HoodieMetaserverConfig.class},
 conf, basePath, consistencyGuardConfig, recordMergerStrategy, 
fileSystemRetryConfig,
-metaserverConfig.getDatabaseName(), metaserverConfig.getTableName(), 
metaserverConfig)
+Option.of(metaserverConfig.getDatabaseName()), 
Option.of(metaserverConfig.getTableName()), metaserverConfig)
 : new HoodieTableMetaClient(conf, basePath,

Review Comment:
   How could the option be empty? Maybe you should use `Option.ofNullable`



-- 
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-unsubscr...@hudi.apache.org

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



[GitHub] [hudi] danny0405 commented on a diff in pull request #9330: [HUDI-6622] Reuse the table config from HoodieTableMetaClient in the …

2023-08-02 Thread via GitHub


danny0405 commented on code in PR #9330:
URL: https://github.com/apache/hudi/pull/9330#discussion_r1281648845


##
hudi-platform-service/hudi-metaserver/hudi-metaserver-client/src/main/java/org/apache/hudi/common/table/HoodieTableMetaserverClient.java:
##
@@ -60,20 +62,22 @@ public HoodieTableMetaserverClient(Configuration conf, 
String basePath, Consiste
  String databaseName, String tableName, 
HoodieMetaserverConfig config) {

Review Comment:
   I'm not saying to change the member variable as Option, I'm talking about 
the params in the constructor.



-- 
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-unsubscr...@hudi.apache.org

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



[GitHub] [hudi] danny0405 commented on a diff in pull request #9330: [HUDI-6622] Reuse the table config from HoodieTableMetaClient in the …

2023-08-01 Thread via GitHub


danny0405 commented on code in PR #9330:
URL: https://github.com/apache/hudi/pull/9330#discussion_r1281395591


##
hudi-platform-service/hudi-metaserver/hudi-metaserver-client/src/main/java/org/apache/hudi/common/table/HoodieTableMetaserverClient.java:
##
@@ -63,15 +60,12 @@ public HoodieTableMetaserverClient(Configuration conf, 
String basePath, Consiste
  String databaseName, String tableName, 
HoodieMetaserverConfig config) {
 super(conf, basePath, false, consistencyGuardConfig, 
Option.of(TimelineLayoutVersion.CURR_LAYOUT_VERSION),
 config.getString(HoodieTableConfig.PAYLOAD_CLASS_NAME), 
mergerStrategy, fileSystemRetryConfig);
-checkArgument(nonEmpty(databaseName), "database name is required.");
-checkArgument(nonEmpty(tableName), "table name is required.");

Review Comment:
   Instead of null, can we change the param type as an Option ?



-- 
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-unsubscr...@hudi.apache.org

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



[GitHub] [hudi] danny0405 commented on a diff in pull request #9330: [HUDI-6622] Reuse the table config from HoodieTableMetaClient in the …

2023-08-01 Thread via GitHub


danny0405 commented on code in PR #9330:
URL: https://github.com/apache/hudi/pull/9330#discussion_r1280304744


##
hudi-platform-service/hudi-metaserver/hudi-metaserver-client/src/main/java/org/apache/hudi/common/table/HoodieTableMetaserverClient.java:
##
@@ -60,18 +60,17 @@ public class HoodieTableMetaserverClient extends 
HoodieTableMetaClient {
 
   public HoodieTableMetaserverClient(Configuration conf, String basePath, 
ConsistencyGuardConfig consistencyGuardConfig,
  String mergerStrategy, 
FileSystemRetryConfig fileSystemRetryConfig,
- String databaseName, String tableName, 
HoodieMetaserverConfig config) {
+ HoodieMetaserverConfig config) {
 super(conf, basePath, false, consistencyGuardConfig, 
Option.of(TimelineLayoutVersion.CURR_LAYOUT_VERSION),
 config.getString(HoodieTableConfig.PAYLOAD_CLASS_NAME), 
mergerStrategy, fileSystemRetryConfig);
-checkArgument(nonEmpty(databaseName), "database name is required.");
-checkArgument(nonEmpty(tableName), "table name is required.");
-this.databaseName = databaseName;
-this.tableName = tableName;
+checkArgument(nonEmpty(tableConfig.getDatabaseName()), "database name is 
required.");
+checkArgument(nonEmpty(tableConfig.getTableName()), "table name is 
required.");
+this.databaseName = tableConfig.getDatabaseName();

Review Comment:
   Where was the table config initialized ?



-- 
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-unsubscr...@hudi.apache.org

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