Github user mateiz commented on a diff in the pull request:
https://github.com/apache/spark/pull/266#discussion_r11319306
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala ---
@@ -45,16 +43,15 @@ object RawTextSender extends Logging {
// Repeat the input data multiple times to fill in a buffer
val lines = Source.fromFile(file).getLines().toArray
- val bufferStream = new FastByteArrayOutputStream(blockSize + 1000)
+ val bufferStream = new ByteArrayOutputStream(blockSize + 1000)
val ser = new KryoSerializer(new SparkConf()).newInstance()
val serStream = ser.serializeStream(bufferStream)
var i = 0
- while (bufferStream.position < blockSize) {
+ while (bufferStream.size < blockSize) {
--- End diff --
I believe "size" returns the size of the current buffer, not necessarily
the size written. Can you test it? We may need to keep a separate counter to
measure the amount of data read.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---