yuqi1129 commented on code in PR #4939:
URL: https://github.com/apache/gravitino/pull/4939#discussion_r1764906513
##########
catalogs/catalog-lakehouse-paimon/src/main/java/org/apache/gravitino/catalog/lakehouse/paimon/utils/CatalogUtils.java:
##########
@@ -120,4 +122,37 @@ private static void checkPaimonConfig(PaimonConfig
paimonConfig) {
StringUtils.isNotBlank(uri), "Paimon Catalog uri can not be null or
empty.");
}
}
+
+ public static void checkWarehouseConfig(
+ PaimonConfig paimonConfig, Map<String, String> resultConf) {
+ String warehouse = paimonConfig.get(CATALOG_WAREHOUSE);
+ Preconditions.checkArgument(
+ StringUtils.isNotBlank(warehouse), "Paimon Catalog warehouse can not
be null or empty.");
+
+ FileSystemType fileSystemType = FileSystemType.fromStoragePath(warehouse);
+ switch (fileSystemType) {
+ case S3:
+ checkS3FileSystemConfig(resultConf);
+ break;
+ case HDFS:
+ case OSS:
+ case LOCAL_FILE:
+ break;
+ default:
+ throw new IllegalArgumentException("Unsupported file system type: " +
fileSystemType);
+ }
+ }
+
+ private static void checkS3FileSystemConfig(Map<String, String> resultConf) {
Review Comment:
https://github.com/apache/gravitino/pull/4939/files#diff-0c775b587b52f59019d196d56c6de96c190a6320085c91ad7757e5ac8255bef5R54
aims to solve the problem that if the users set the key, then the values
should not be null or empty. If the key is not set, the check is useless.
This is to address the problem that users should set the key and the value
can't be null or empty.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]