You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2014/06/11 02:26:26 UTC

git commit: [SPARK-1998] SparkFlumeEvent with body bigger than 1020 bytes are not re...

Repository: spark
Updated Branches:
  refs/heads/master 1abbde0e8 -> 296604430


[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 <su...@gmail.com>

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


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/29660443
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/29660443
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/29660443

Branch: refs/heads/master
Commit: 29660443077619ee854025b8d0d3d64181724054
Parents: 1abbde0
Author: joyyoj <su...@gmail.com>
Authored: Tue Jun 10 17:26:17 2014 -0700
Committer: Patrick Wendell <pw...@gmail.com>
Committed: Tue Jun 10 17:26:17 2014 -0700

----------------------------------------------------------------------
 .../org/apache/spark/streaming/flume/FlumeInputDStream.scala     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/29660443/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeInputDStream.scala
----------------------------------------------------------------------
diff --git a/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeInputDStream.scala b/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeInputDStream.scala
index 5be33f1..ed35e34 100644
--- a/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeInputDStream.scala
+++ b/external/flume/src/main/scala/org/apache/spark/streaming/flume/FlumeInputDStream.scala
@@ -71,12 +71,12 @@ class SparkFlumeEvent() extends Externalizable {
     for (i <- 0 until numHeaders) {
       val keyLength = in.readInt()
       val keyBuff = new Array[Byte](keyLength)
-      in.read(keyBuff)
+      in.readFully(keyBuff)
       val key : String = Utils.deserialize(keyBuff)
 
       val valLength = in.readInt()
       val valBuff = new Array[Byte](valLength)
-      in.read(valBuff)
+      in.readFully(valBuff)
       val value : String = Utils.deserialize(valBuff)
 
       headers.put(key, value)