Z1Wu commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1952810661


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), 
location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), 
fetchTimeoutMs);
-        streamHandler = 
TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), 
location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), 
fetchTimeoutMs);
+          streamHandler = 
TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   Fixed. Please review it again.



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

Reply via email to