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


##########
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:
   - isMetadataPartitionSupported
   - isMetadataPartitionEnabled
   - isMetadataPartitionAvailable
   
   Looks very confusing from high-level, can we clean them up? and instead of 
passing around metaClient, can we just passes the table config?



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