Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/20555#discussion_r168036836
--- Diff: core/src/main/java/org/apache/spark/io/ReadAheadInputStream.java
---
@@ -78,9 +79,8 @@
// whether there is a read ahead task running,
private boolean isReading;
- // If the remaining data size in the current buffer is below this
threshold,
- // we issue an async read from the underlying input stream.
- private final int readAheadThresholdInBytes;
+ // whether there is a reader waiting for data.
+ private AtomicBoolean isWaiting = new AtomicBoolean(false);
--- End diff --
You can just use `volatile` here
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]