zhuanshenbsj1 commented on code in PR #10002:
URL: https://github.com/apache/hudi/pull/10002#discussion_r1399228278


##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java:
##########
@@ -164,27 +164,32 @@ public List<HoodieFileGroup> addFilesToView(FileStatus[] 
statuses) {
     List<HoodieFileGroup> fileGroups = buildFileGroups(statuses, 
visibleCommitsAndCompactionTimeline, true);
     long fgBuildTimeTakenMs = timer.endTimer();
     timer.startTimer();
-    // Group by partition for efficient updates for both InMemory and 
DiskBased structures.
-    
fileGroups.stream().collect(Collectors.groupingBy(HoodieFileGroup::getPartitionPath)).forEach((partition,
 value) -> {
-      if (!isPartitionAvailableInStore(partition)) {
-        if (bootstrapIndex.useIndex()) {
-          try (BootstrapIndex.IndexReader reader = 
bootstrapIndex.createReader()) {
-            LOG.info("Bootstrap Index available for partition " + partition);
-            List<BootstrapFileMapping> sourceFileMappings =
-                reader.getSourceFileMappingForPartition(partition);
-            addBootstrapBaseFileMapping(sourceFileMappings.stream()
-                .map(s -> new BootstrapBaseFileMapping(new 
HoodieFileGroupId(s.getPartitionPath(),
-                    s.getFileId()), s.getBootstrapFileStatus())));
+    writeLock.lock();
+    try {

Review Comment:
   foreach(partition) : isPartitionAvailableInStore(partition) -> 
storePartitionView(partition, value);
   
   This must be atomic to ensure thread safety for partitionToFileGroupsMap.
   
   
   



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