jerryshao commented on code in PR #8254:
URL: https://github.com/apache/gravitino/pull/8254#discussion_r2303309758
##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -146,13 +146,15 @@ protected BaseGVFSOperations(Configuration configuration)
{
"'%s' is not set in the configuration",
GravitinoVirtualFileSystemConfiguration.FS_GRAVITINO_CLIENT_METALAKE_KEY);
- GravitinoClient client =
GravitinoVirtualFileSystemUtils.createClient(configuration);
- this.filesetCatalogCache = new FilesetCatalogCache(client);
+ this.gravitinoClient =
GravitinoVirtualFileSystemUtils.createClient(configuration);
+ this.enableFilesetCatalogCache =
+ configuration.getBoolean(
+ FS_GRAVITINO_FILESET_CATALOG_CACHE_ENABLE,
+ FS_GRAVITINO_FILESET_CATALOG_CACHE_ENABLE_DEFAULT);
+ this.filesetCatalogCache =
+ enableFilesetCatalogCache ? new FilesetCatalogCache(gravitinoClient) :
null;
Review Comment:
I don't like specifically setting `null` value in the code, it is
error-prone. You'd better use `Optional` instead.
--
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]