Jibing-Li commented on code in PR #35474:
URL: https://github.com/apache/doris/pull/35474#discussion_r1616500036
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/PublishVersionDaemon.java:
##########
@@ -302,7 +302,14 @@ private List<TPartitionVersionInfo>
generatePartitionVersionInfos(Collection<Tab
private List<TPartitionVersionInfo>
generatePartitionVersionInfos(TableCommitInfo tableCommitInfo,
TransactionState transactionState, Map<Long, Set<Long>>
beIdToBaseTabletIds) {
try {
-
beIdToBaseTabletIds.putAll(getBaseTabletIdsForEachBe(transactionState,
tableCommitInfo));
+ Map<Long, Set<Long>> map =
getBaseTabletIdsForEachBe(transactionState, tableCommitInfo);
+ map.forEach((beId, newSet) -> {
+ beIdToBaseTabletIds.computeIfPresent(beId, (id, orgSet) -> {
+ orgSet.addAll(newSet);
+ return orgSet;
+ });
+ beIdToBaseTabletIds.putIfAbsent(beId, newSet);
Review Comment:
```
default V computeIfPresent(K key,
BiFunction<? super K, ? super V, ? extends V> remappingFunction)
{
Objects.requireNonNull(remappingFunction);
V oldValue;
if ((oldValue = get(key)) != null) {
V newValue = remappingFunction.apply(key, oldValue);
if (newValue != null) {
put(key, newValue);
return newValue;
} else {
remove(key);
return null;
}
} else {
return null;
}
}
```
Look at the outer else branch, it seems like we need to keep line 311.
Because it doesn't put new value to the map when the key doesn't exist.
--
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]