yihua commented on code in PR #5286:
URL: https://github.com/apache/hudi/pull/5286#discussion_r913317157


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/TestHoodieIndexer.java:
##########
@@ -192,9 +191,9 @@ public void testIndexerForExceptionWithNonFilesPartition() {
 
     // validate table config
     metaClient = reload(metaClient);
-    
assertFalse(getCompletedMetadataPartitions(metaClient.getTableConfig()).contains(FILES.getPartitionPath()));
-    
assertFalse(getCompletedMetadataPartitions(metaClient.getTableConfig()).contains(COLUMN_STATS.getPartitionPath()));
-    
assertFalse(getCompletedMetadataPartitions(metaClient.getTableConfig()).contains(BLOOM_FILTERS.getPartitionPath()));
+    
assertFalse(reload(metaClient).getTableConfig().getMetadataPartitions().contains(FILES.getPartitionPath()));
+    
assertFalse(reload(metaClient).getTableConfig().getMetadataPartitions().contains(COLUMN_STATS.getPartitionPath()));
+    
assertFalse(reload(metaClient).getTableConfig().getMetadataPartitions().contains(BLOOM_FILTERS.getPartitionPath()));

Review Comment:
   No need to reload the metaClient here?



##########
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java:
##########
@@ -618,11 +621,14 @@ public List<String> getMetadataPartitionsInflight() {
     );
   }
 
-  public List<String> getMetadataPartitions() {
-    return StringUtils.split(
-        getStringOrDefault(TABLE_METADATA_PARTITIONS, 
StringUtils.EMPTY_STRING),
-        CONFIG_VALUES_DELIMITER
-    );
+  public Set<String> getMetadataPartitions() {
+    if (metadataPartition == null) {
+      metadataPartition = new HashSet<>(
+              StringUtils.split(getStringOrDefault(TABLE_METADATA_PARTITIONS, 
StringUtils.EMPTY_STRING),
+                      CONFIG_VALUES_DELIMITER)
+      );

Review Comment:
   This is not thread-safe.  Could the method just return a new HashSet 
instance each time?



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