jerqi commented on PR #1120:
URL: 
https://github.com/apache/incubator-uniffle/pull/1120#issuecomment-1669700343

   We should modify the method from
   ```
    public StatusCode registerShuffle(
         String appId,
         int shuffleId,
         List<PartitionRange> partitionRanges,
         RemoteStorageInfo remoteStorageInfo,
         String user,
         ShuffleDataDistributionType dataDistType,
         int maxConcurrencyPerPartitionToWrite) {
       refreshAppId(appId);
   
       ShuffleTaskInfo taskInfo = shuffleTaskInfos.get(appId);
       taskInfo.setUser(user);
       taskInfo.setSpecification(
           ShuffleSpecification.builder()
               .maxConcurrencyPerPartitionToWrite(
                   getMaxConcurrencyWriting(maxConcurrencyPerPartitionToWrite, 
conf))
               .dataDistributionType(dataDistType)
               .build());
   ```
   to
   ```
    public StatusCode registerShuffle(
         String appId,
         int shuffleId,
         List<PartitionRange> partitionRanges,
         RemoteStorageInfo remoteStorageInfo,
         String user,
         ShuffleDataDistributionType dataDistType,
         int maxConcurrencyPerPartitionToWrite) {
       shuffleTaskInfos
           .computeIfAbsent(
               appId,
               x -> {
                 ShuffleServerMetrics.counterTotalAppNum.inc();
                 return new ShuffleTaskInfo(appId);
               })
           .setCurrentTimes(System.currentTimeMillis());
   ```
   And change the method `refreshAppId` from 
   ```
     public void refreshAppId(String appId) {
       shuffleTaskInfos
           .computeIfAbsent(
               appId,
               x -> {
                 ShuffleServerMetrics.counterTotalAppNum.inc();
                 return new ShuffleTaskInfo(appId);
               })
           .setCurrentTimes(System.currentTimeMillis());
     
   ```
   to
   ```
     public void refreshAppId(String appId) {
       TaskInfo info = shuffleTaskInfos.get(appId);
        if (info != null) {
          info.setCurrentTimes(System.currentTimeMillis());
        }
   ```
   


-- 
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]

Reply via email to