caican00 commented on code in PR #4939:
URL: https://github.com/apache/gravitino/pull/4939#discussion_r1760075347
##########
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:
this check looks repeated.
https://github.com/apache/gravitino/pull/4939/files#diff-0c775b587b52f59019d196d56c6de96c190a6320085c91ad7757e5ac8255bef5R54
--
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]