Skip to content

Commit

Permalink
[Minor] Store shuffleId int to be consistent with other data structure (
Browse files Browse the repository at this point in the history
#10)

### What changes were proposed in this pull request?
Store shuffleId int to be consistent with other data structure

### Why are the changes needed?
Store shuffleId int to be consistent with other data structure, like the `partitionsToBlockIds` and `commitLocks`.

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

### How was this patch tested?
No need.
  • Loading branch information
zuston committed Jul 2, 2022
1 parent 1cb0e02 commit b0fe5f3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class ShuffleTaskManager {
private ShuffleBufferManager shuffleBufferManager;
private Map<String, Long> appIds = Maps.newConcurrentMap();
// appId -> shuffleId -> commit count
private Map<String, Map<Long, AtomicInteger>> commitCounts = Maps.newConcurrentMap();
private Map<String, Map<Integer, AtomicInteger>> commitCounts = Maps.newConcurrentMap();
private Map<String, Map<Integer, Object>> commitLocks = Maps.newConcurrentMap();
// appId -> shuffleId -> blockIds
private Map<String, Map<Integer, Roaring64NavigableMap>> cachedBlockIds = Maps.newConcurrentMap();
Expand Down Expand Up @@ -229,9 +229,9 @@ public void addFinishedBlockIds(
}
}

public int updateAndGetCommitCount(String appId, long shuffleId) {
public int updateAndGetCommitCount(String appId, int shuffleId) {
commitCounts.putIfAbsent(appId, Maps.newConcurrentMap());
Map<Long, AtomicInteger> shuffleCommit = commitCounts.get(appId);
Map<Integer, AtomicInteger> shuffleCommit = commitCounts.get(appId);
shuffleCommit.putIfAbsent(shuffleId, new AtomicInteger(0));
AtomicInteger commitNum = shuffleCommit.get(shuffleId);
return commitNum.incrementAndGet();
Expand Down

0 comments on commit b0fe5f3

Please sign in to comment.