Skip to content
Snippets Groups Projects
Commit c33f0ef4 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

Some style cleanup

parent 3446d5c8
No related branches found
No related tags found
No related merge requests found
...@@ -104,19 +104,17 @@ private[spark] class PythonRDD[T: ClassManifest]( ...@@ -104,19 +104,17 @@ private[spark] class PythonRDD[T: ClassManifest](
private def read(): Array[Byte] = { private def read(): Array[Byte] = {
try { try {
stream.readInt() match { stream.readInt() match {
case length if length > 0 => { case length if length > 0 =>
val obj = new Array[Byte](length) val obj = new Array[Byte](length)
stream.readFully(obj) stream.readFully(obj)
obj obj
} case -2 =>
case -2 => {
// Signals that an exception has been thrown in python // Signals that an exception has been thrown in python
val exLength = stream.readInt() val exLength = stream.readInt()
val obj = new Array[Byte](exLength) val obj = new Array[Byte](exLength)
stream.readFully(obj) stream.readFully(obj)
throw new PythonException(new String(obj)) throw new PythonException(new String(obj))
} case -1 =>
case -1 => {
// We've finished the data section of the output, but we can still read some // We've finished the data section of the output, but we can still read some
// accumulator updates; let's do that, breaking when we get EOFException // accumulator updates; let's do that, breaking when we get EOFException
while (true) { while (true) {
...@@ -124,9 +122,8 @@ private[spark] class PythonRDD[T: ClassManifest]( ...@@ -124,9 +122,8 @@ private[spark] class PythonRDD[T: ClassManifest](
val update = new Array[Byte](len2) val update = new Array[Byte](len2)
stream.readFully(update) stream.readFully(update)
accumulator += Collections.singletonList(update) accumulator += Collections.singletonList(update)
new Array[Byte](0)
} }
new Array[Byte](0)
}
} }
} catch { } catch {
case eof: EOFException => { case eof: EOFException => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment