Skip to content

Commit

Permalink
[#1373][FOLLOWUP] fix(spark): incorrect partition id type (#1582)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

fix partition id type is incorrect

### Why are the changes needed?
Fix: (#1373)

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Not necessary.
  • Loading branch information
dingshun3016 committed Mar 15, 2024
1 parent 0b66472 commit c3c0c37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -898,16 +898,17 @@ public ShuffleServerInfo reassignFaultyShuffleServerForTasks(
ShuffleServerInfo newAssignedServer = assignShuffleServer(shuffleId, id);
ShuffleHandleInfo shuffleHandleInfo = shuffleIdToShuffleHandleInfo.get(shuffleId);
for (String partitionId : partitionIds) {
Integer partitionIdInteger = Integer.valueOf(partitionId);
List<ShuffleServerInfo> shuffleServerInfoList =
shuffleHandleInfo.getPartitionToServers().get(partitionId);
shuffleHandleInfo.getPartitionToServers().get(partitionIdInteger);
for (int i = 0; i < shuffleServerInfoList.size(); i++) {
if (shuffleServerInfoList.get(i).getId().equals(faultyShuffleServerId)) {
shuffleHandleInfo
.getFailoverPartitionServers()
.computeIfAbsent(Integer.valueOf(partitionId), k -> Maps.newHashMap());
.computeIfAbsent(partitionIdInteger, k -> Maps.newHashMap());
shuffleHandleInfo
.getFailoverPartitionServers()
.get(partitionId)
.get(partitionIdInteger)
.computeIfAbsent(i, j -> Lists.newArrayList())
.add(newAssignedServer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1190,16 +1190,17 @@ public ShuffleServerInfo reassignFaultyShuffleServerForTasks(
ShuffleServerInfo newAssignedServer = assignShuffleServer(shuffleId, id);
ShuffleHandleInfo shuffleHandleInfo = shuffleIdToShuffleHandleInfo.get(shuffleId);
for (String partitionId : partitionIds) {
Integer partitionIdInteger = Integer.valueOf(partitionId);
List<ShuffleServerInfo> shuffleServerInfoList =
shuffleHandleInfo.getPartitionToServers().get(partitionId);
shuffleHandleInfo.getPartitionToServers().get(partitionIdInteger);
for (int i = 0; i < shuffleServerInfoList.size(); i++) {
if (shuffleServerInfoList.get(i).getId().equals(faultyShuffleServerId)) {
shuffleHandleInfo
.getFailoverPartitionServers()
.computeIfAbsent(Integer.valueOf(partitionId), k -> Maps.newHashMap());
.computeIfAbsent(partitionIdInteger, k -> Maps.newHashMap());
shuffleHandleInfo
.getFailoverPartitionServers()
.get(partitionId)
.get(partitionIdInteger)
.computeIfAbsent(i, j -> Lists.newArrayList())
.add(newAssignedServer);
}
Expand Down

0 comments on commit c3c0c37

Please sign in to comment.