stalary commented on code in PR #11365:
URL: https://github.com/apache/doris/pull/11365#discussion_r933948394


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java:
##########
@@ -128,128 +131,131 @@ public void tabletReport(long backendId, Map<Long, 
TTablet> backendTablets,
             LOG.info("begin to do tablet diff with backend[{}]. num: {}", 
backendId, backendTablets.size());
             Map<Long, Replica> replicaMetaWithBackend = 
backingReplicaMetaTable.row(backendId);
             if (replicaMetaWithBackend != null) {
-                // traverse replicas in meta with this backend
-                
replicaMetaWithBackend.entrySet().parallelStream().forEach(entry -> {
-                    long tabletId = entry.getKey();
-                    
Preconditions.checkState(tabletMetaMap.containsKey(tabletId));
-                    TabletMeta tabletMeta = tabletMetaMap.get(tabletId);
-
-                    if (backendTablets.containsKey(tabletId)) {
-                        TTablet backendTablet = backendTablets.get(tabletId);
-                        Replica replica = entry.getValue();
-                        tabletFoundInMeta.add(tabletId);
-                        TTabletInfo backendTabletInfo = 
backendTablet.getTabletInfos().get(0);
-                        if (partitionIdInMemorySet.contains(
-                                backendTabletInfo.getPartitionId()) != 
backendTabletInfo.isIsInMemory()) {
-                            synchronized (tabletToInMemory) {
-                                tabletToInMemory.add(new 
ImmutableTriple<>(tabletId, backendTabletInfo.getSchemaHash(),
-                                        !backendTabletInfo.isIsInMemory()));
+                taskPool.submit(() -> {
+                    // traverse replicas in meta with this backend
+                    
replicaMetaWithBackend.entrySet().parallelStream().forEach(entry -> {

Review Comment:
   I have a question, under what amount of data does 
parallelStream+synchronized performance more than Stream



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to