You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "FMX (via GitHub)" <gi...@apache.org> on 2023/02/15 03:22:22 UTC
[GitHub] [incubator-celeborn] FMX commented on a diff in pull request #1232: [CELEBORN-295] Pipeline sort pusher by double-buffering
FMX commented on code in PR #1232:
URL: https://github.com/apache/incubator-celeborn/pull/1232#discussion_r1106604289
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/celeborn/SortBasedPusher.java:
##########
@@ -219,6 +230,39 @@ public void insertRecord(
pageCursor += recordSize;
}
inMemSorter.insertRecord(recordAddress, partitionId);
+
+ return true;
+ }
+
+ public void triggerPush() throws IOException {
+ dataPusher.checkException();
+ if (pushing) {
+ throw new IOException("Re-trigger push!");
+ }
+ pushing = true;
+ Thread thread =
+ new Thread(
+ () -> {
+ try {
+ pushData();
+ pushing = false;
+ } catch (IOException ie) {
+ dataPusher.setException(ie);
+ }
+ });
+ thread.start();
+ }
+
+ public void waitPushFinish() throws IOException {
+ dataPusher.checkException();
+ while (pushing) {
+ try {
+ Thread.sleep(100);
Review Comment:
This waiting might waste time.
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/celeborn/SortBasedPusher.java:
##########
@@ -219,6 +230,39 @@ public void insertRecord(
pageCursor += recordSize;
}
inMemSorter.insertRecord(recordAddress, partitionId);
+
+ return true;
+ }
+
+ public void triggerPush() throws IOException {
+ dataPusher.checkException();
+ if (pushing) {
+ throw new IOException("Re-trigger push!");
+ }
+ pushing = true;
+ Thread thread =
+ new Thread(
+ () -> {
+ try {
+ pushData();
+ pushing = false;
+ } catch (IOException ie) {
+ dataPusher.setException(ie);
+ }
+ });
+ thread.start();
+ }
+
+ public void waitPushFinish() throws IOException {
+ dataPusher.checkException();
+ while (pushing) {
+ try {
+ Thread.sleep(100);
Review Comment:
I think waiting is not a good solution here. Maybe lock or sync will be better here.
##########
client-spark/spark-3/src/main/java/org/apache/spark/shuffle/celeborn/SortBasedShuffleWriter.java:
##########
@@ -70,7 +70,8 @@
private final int numPartitions;
private final long pushBufferMaxSize;
- private SortBasedPusher sortBasedPusher;
+ private SortBasedPusher[] pushers = new SortBasedPusher[2];
Review Comment:
Two data pushers might be not enough, maybe adding a configuration will be better.
--
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: issues-unsubscribe@celeborn.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org