mchades commented on code in PR #8950:
URL: https://github.com/apache/gravitino/pull/8950#discussion_r2471574643
##########
clients/filesystem-hadoop3/src/main/java/org/apache/gravitino/filesystem/hadoop/BaseGVFSOperations.java:
##########
@@ -187,6 +188,27 @@ protected BaseGVFSOperations(Configuration configuration) {
this.conf = configuration;
}
+ /**
+ * Lazy initialization of FilesetMetadataCache, see
getFilesetMetadataCache() for details.
+ *
+ * @return the FilesetMetadataCache.
+ */
+ @VisibleForTesting
+ protected Optional<FilesetMetadataCache> getFilesetMetadataCache() {
+ if (filesetMetadataCache == null) {
+ synchronized (filesetMetadataCacheLock) {
+ if (filesetMetadataCache == null) {
+ if (!enableFilesetMetadataCache) {
+ this.filesetMetadataCache = Optional.empty();
+ } else {
+ this.filesetMetadataCache = Optional.of(new
FilesetMetadataCache(getGravitinoClient()));
Review Comment:
You can simplify it using `enableFilesetMetadataCache ? xxx : xxx`
--
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]