Skip to content

Commit

Permalink
Fix scala style and other minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tdas committed Aug 25, 2015
1 parent 89aaf9b commit 9a81b93
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class ReceiverInputDStreamSuite extends TestSuiteBase with BeforeAndAfterAll {
StreamingContext.getActive().map { _.stop() }
}


testWithoutWAL("createBlockRDD creates empty BlockRDD when no block info") { receiverStream =>
val rdd = receiverStream.createBlockRDD(Time(0), Seq.empty)
assert(rdd.isInstanceOf[BlockRDD[_]])
assert(!rdd.isInstanceOf[WriteAheadLogBackedBlockRDD[_]])
assert(rdd.isEmpty())
}

Expand All @@ -52,6 +52,7 @@ class ReceiverInputDStreamSuite extends TestSuiteBase with BeforeAndAfterAll {

val rdd = receiverStream.createBlockRDD(Time(0), blockInfos)
assert(rdd.isInstanceOf[BlockRDD[_]])
assert(!rdd.isInstanceOf[WriteAheadLogBackedBlockRDD[_]])
val blockRDD = rdd.asInstanceOf[BlockRDD[_]]
assert(blockRDD.blockIds.toSeq === blockIds)
}
Expand Down Expand Up @@ -111,7 +112,7 @@ class ReceiverInputDStreamSuite extends TestSuiteBase with BeforeAndAfterAll {
}
}

private def testWithWAL(msg: String)(body: ReceiverInputDStream[_] => Unit):Unit = {
private def testWithWAL(msg: String)(body: ReceiverInputDStream[_] => Unit): Unit = {
test(s"With WAL enabled: $msg") {
runTest(enableWAL = true, body)
}
Expand All @@ -131,6 +132,12 @@ class ReceiverInputDStreamSuite extends TestSuiteBase with BeforeAndAfterAll {
}
}

/**
* Create a block info for input to the ReceiverInputDStream.createBlockRDD
* @param withWALInfo Create block with WAL info in it
* @param createBlock Actually create the block in the BlockManager
* @return
*/
private def createBlockInfo(
withWALInfo: Boolean,
createBlock: Boolean = true): ReceivedBlockInfo = {
Expand Down

0 comments on commit 9a81b93

Please sign in to comment.