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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##########
@@ -193,8 +194,16 @@ protected 
HoodieBackedTableMetadataWriter(StorageConfiguration<?> storageConf,
     ValidationUtils.checkArgument(!initialized || this.metadata != null, "MDT 
Reader should have been opened post initialization");
   }
 
+  @VisibleForTesting
   List<MetadataPartitionType> getEnabledPartitions(HoodieMetadataConfig 
metadataConfig, HoodieTableMetaClient metaClient) {
-    return MetadataPartitionType.getEnabledPartitions(metadataConfig, 
metaClient);
+    if (!metadataConfig.isEnabled()) {
+      return Collections.emptyList();
+    }
+    return MetadataPartitionType.getValidValues().stream()
+        .filter(partitionType -> 
partitionType.isMetadataPartitionSupported(metaClient)
+            && (partitionType.isMetadataPartitionEnabled(metadataConfig)
+            || partitionType.isMetadataPartitionAvailable(metaClient)))
+        .collect(Collectors.toList());

Review Comment:
   > So, not sure how we can fold all these into one method.
   
   Just supported or not, let's hide these discrepencies inside and not make 
them public APIs.



-- 
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]

Reply via email to