kaijchen commented on code in PR #470:
URL: https://github.com/apache/incubator-uniffle/pull/470#discussion_r1090142749
##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -192,12 +206,27 @@ private boolean sendShuffleDataAsync(
return result;
}
- private void genServerToBlocks(ShuffleBlockInfo sbi, List<ShuffleServerInfo>
serverList,
- Map<ShuffleServerInfo, Map<Integer, Map<Integer,
List<ShuffleBlockInfo>>>> serverToBlocks,
- Map<ShuffleServerInfo, List<Long>> serverToBlockIds) {
+ void genServerToBlocks(ShuffleBlockInfo sbi,
+ List<ShuffleServerInfo> serverList,
+ int replicaNum,
+ List<ShuffleServerInfo> excludeServers,
+ Map<ShuffleServerInfo, Map<Integer, Map<Integer,
List<ShuffleBlockInfo>>>> serverToBlocks,
+ Map<ShuffleServerInfo, List<Long>> serverToBlockIds,
+ boolean includeBlockList) {
Review Comment:
Why is it always negated in line 223, should we name it `excludeBlocklist`
instead?
i.e. change `if (!includeBlockList && ...` to `if (excludeBlocklist && ...`
##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -105,6 +106,7 @@ public class ShuffleWriteClientImpl implements
ShuffleWriteClient {
private final ExecutorService dataTransferPool;
private final int unregisterThreadPoolSize;
private final int unregisterRequestTimeSec;
+ private Set<ShuffleServerInfo> shuffleServerBlockList;
Review Comment:
should be `Blocklist` instead of `BlockList`.
##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -192,12 +206,27 @@ private boolean sendShuffleDataAsync(
return result;
}
- private void genServerToBlocks(ShuffleBlockInfo sbi, List<ShuffleServerInfo>
serverList,
- Map<ShuffleServerInfo, Map<Integer, Map<Integer,
List<ShuffleBlockInfo>>>> serverToBlocks,
- Map<ShuffleServerInfo, List<Long>> serverToBlockIds) {
+ void genServerToBlocks(ShuffleBlockInfo sbi,
+ List<ShuffleServerInfo> serverList,
+ int replicaNum,
+ List<ShuffleServerInfo> excludeServers,
+ Map<ShuffleServerInfo, Map<Integer, Map<Integer,
List<ShuffleBlockInfo>>>> serverToBlocks,
+ Map<ShuffleServerInfo, List<Long>> serverToBlockIds,
+ boolean includeBlockList) {
+ if (replicaNum <= 0) {
+ return;
+ }
int partitionId = sbi.getPartitionId();
int shuffleId = sbi.getShuffleId();
+ int assignedNum = 0;
for (ShuffleServerInfo ssi : serverList) {
+ if (!includeBlockList && replica > 1 && !shuffleServerBlockList.isEmpty()
+ && shuffleServerBlockList.contains(ssi)) {
Review Comment:
`!shuffleServerBlockList.isEmpty() && shuffleServerBlockList.contains(ssi)`
can be simplified to just `shuffleServerBlockList.contains(ssi)` ?
--
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]