Skip to content

Commit ac8c27b

Browse files
joyyojpwendell
authored andcommitted
[SPARK-1998] SparkFlumeEvent with body bigger than 1020 bytes are not re...
flume event sent to Spark will fail if the body is too large and numHeaders is greater than zero Author: joyyoj <[email protected]> Closes #951 from joyyoj/master and squashes the following commits: f4660c5 [joyyoj] [SPARK-1998] SparkFlumeEvent with body bigger than 1020 bytes are not read properly (cherry picked from commit 2966044) Signed-off-by: Patrick Wendell <[email protected]>
1 parent 86c4a79 commit ac8c27b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeInputDStream.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ class SparkFlumeEvent() extends Externalizable {
7171
for (i <- 0 until numHeaders) {
7272
val keyLength = in.readInt()
7373
val keyBuff = new Array[Byte](keyLength)
74-
in.read(keyBuff)
74+
in.readFully(keyBuff)
7575
val key : String = Utils.deserialize(keyBuff)
7676

7777
val valLength = in.readInt()
7878
val valBuff = new Array[Byte](valLength)
79-
in.read(valBuff)
79+
in.readFully(valBuff)
8080
val value : String = Utils.deserialize(valBuff)
8181

8282
headers.put(key, value)

0 commit comments

Comments
 (0)