turboFei commented on code in PR #3178:
URL: https://github.com/apache/celeborn/pull/3178#discussion_r2014958094
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/storage/FlushTask.scala:
##########
@@ -40,12 +40,11 @@ private[worker] class LocalFlushTask(
keepBuffer: Boolean) extends FlushTask(buffer, notifier, keepBuffer) {
override def flush(): Unit = {
val buffers = buffer.nioBuffers()
- for (buffer <- buffers) {
- while (buffer.hasRemaining) {
- fileChannel.write(buffer)
- }
+ val readableBytes = buffer.readableBytes()
+ var written = fileChannel.write(buffers)
+ while (written != readableBytes) {
+ written = fileChannel.write(buffers) + written
Review Comment:
nit:
```
var written = 0L
do {
written = fileChannel.write(buffers) + written
} while (written != readableBytes)
```
--
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]