Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
giwa committed Aug 31, 2014
2 parents 4afa390 + 1fd6bc7 commit d68b568
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ class JavaStreamingContext(val ssc: StreamingContext) {
* JavaStreamingContext object contains a number of utility functions.
*/
object JavaStreamingContext {
implicit def fromStreamingContext(ssc: StreamingContext): JavaStreamingContext = new JavaStreamingContext(ssc)
implicit def fromStreamingContext(ssc: StreamingContext):
JavaStreamingContext = new JavaStreamingContext(ssc)

implicit def toStreamingContext(jssc: JavaStreamingContext): StreamingContext = jssc.ssc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class PythonDStream[T: ClassTag](
preservePartitoning: Boolean,
pythonExec: String,
broadcastVars: JList[Broadcast[Array[Byte]]],
accumulator: Accumulator[JList[Array[Byte]]])
extends DStream[Array[Byte]](parent.ssc) {
accumulator: Accumulator[JList[Array[Byte]]]
) extends DStream[Array[Byte]](parent.ssc) {

override def dependencies = List(parent)

Expand All @@ -70,8 +70,10 @@ class PythonDStream[T: ClassTag](
}


private class PythonPairwiseDStream(prev:DStream[Array[Byte]], partitioner: Partitioner) extends
DStream[Array[Byte]](prev.ssc){
private class PythonPairwiseDStream(
prev:DStream[Array[Byte]],
partitioner: Partitioner
) extends DStream[Array[Byte]](prev.ssc){
override def dependencies = List(prev)

override def slideDuration: Duration = prev.slideDuration
Expand Down Expand Up @@ -116,14 +118,14 @@ class PythonForeachDStream(

/**
* This is a input stream just for the unitest. This is equivalent to a checkpointable,
* replayable, reliable message queue like Kafka. It requires a JArrayList input of JavaRDD,
* replayable, reliable message queue like Kafka. It requires a JArrayList of JavaRDD,
* and returns the i_th element at the i_th batch under manual clock.
*/

class PythonTestInputStream(
ssc_ : JavaStreamingContext,
inputRDDs: JArrayList[JavaRDD[Array[Byte]]])
extends InputDStream[Array[Byte]](JavaStreamingContext.toStreamingContext(ssc_)) {
inputRDDs: JArrayList[JavaRDD[Array[Byte]]]
) extends InputDStream[Array[Byte]](JavaStreamingContext.toStreamingContext(ssc_)) {

def start() {}

Expand All @@ -146,4 +148,4 @@ class PythonTestInputStream(
}

val asJavaDStream = JavaDStream.fromDStream(this)
}
}

0 comments on commit d68b568

Please sign in to comment.