somelovelanguage commented on code in PR #1510:
URL:
https://github.com/apache/incubator-uniffle/pull/1510#discussion_r1480856352
##########
server/src/main/java/org/apache/uniffle/server/ShuffleServerGrpcService.java:
##########
@@ -99,6 +102,37 @@ public ShuffleServerGrpcService(ShuffleServer
shuffleServer) {
this.shuffleServer = shuffleServer;
}
+ @Override
+ public void unregisterApp(
+ RssProtos.AppUnregisterRequest request,
+ StreamObserver<RssProtos.AppUnregisterResponse> responseStreamObserver) {
+ String appId = request.getAppId();
+
+ StatusCode result = StatusCode.SUCCESS;
+ String responseMessage = "OK";
+ try {
+ Map<Integer, RangeMap<Integer, ShuffleBuffer>> shuffleIdToBuffers =
+ shuffleServer.getShuffleBufferManager().getBufferPool().get(appId);
+ if (shuffleIdToBuffers != null) {
+ HashSet<Integer> shuffleIds =
Sets.newHashSet(shuffleIdToBuffers.keySet());
+ shuffleIds.forEach(
+ shuffleId ->
+
shuffleServer.getShuffleTaskManager().removeShuffleDataAsync(appId, shuffleId));
Review Comment:
Maybe like this.
```java
public void removeShuffleDataAsync(String appId) {
Map<Integer, RangeMap<Integer, ShuffleBuffer>> shuffleIdToBuffers =
this.shuffleBufferManager.getBufferPool().get(appId);
if (shuffleIdToBuffers != null) {
HashSet<Integer> shuffleIds =
Sets.newHashSet(shuffleIdToBuffers.keySet());
expiredAppIdQueue.add(new ShufflePurgeEvent(appId,
getUserByAppId(appId) , (List<Integer>) shuffleIds);
}
}
```
--
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]