Skip to content

Commit 4a5866f

Browse files
committed
Addressed one more comment.
1 parent ed5fbf0 commit 4a5866f

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

streaming/src/test/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDDSuite.scala

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,27 @@ class WriteAheadLogBackedBlockRDDSuite extends FunSuite with BeforeAndAfterAll {
7676
* and the rest to a write ahead log, and then reading reading it all back using the RDD.
7777
* It can also test if the partitions that were read from the log were again stored in
7878
* block manager.
79-
* @param numPartitionssInBM Number of partitions to write to the Block Manager
79+
* @param numPartitionsInBM Number of partitions to write to the Block Manager
8080
* @param numPartitionsInWAL Number of partitions to write to the Write Ahead Log
8181
* @param testStoreInBM Test whether blocks read from log are stored back into block manager
8282
*/
83-
private def testRDD(
84-
numPartitionssInBM: Int,
85-
numPartitionsInWAL: Int,
86-
testStoreInBM: Boolean = false
87-
) {
88-
val numBlocks = numPartitionssInBM + numPartitionsInWAL
83+
private def testRDD(numPartitionsInBM: Int, numPartitionsInWAL: Int, testStoreInBM: Boolean = false) {
84+
val numBlocks = numPartitionsInBM + numPartitionsInWAL
8985
val data = Seq.fill(numBlocks, 10)(scala.util.Random.nextString(50))
9086

9187
// Put the necessary blocks in the block manager
9288
val blockIds = Array.fill(numBlocks)(StreamBlockId(Random.nextInt(), Random.nextInt()))
93-
data.zip(blockIds).take(numPartitionssInBM).foreach { case(block, blockId) =>
89+
data.zip(blockIds).take(numPartitionsInBM).foreach { case(block, blockId) =>
9490
blockManager.putIterator(blockId, block.iterator, StorageLevel.MEMORY_ONLY_SER)
9591
}
9692

9793
// Generate write ahead log segments
98-
val segments = generateFakeSegments(numPartitionssInBM) ++
94+
val segments = generateFakeSegments(numPartitionsInBM) ++
9995
writeLogSegments(data.takeRight(numPartitionsInWAL), blockIds.takeRight(numPartitionsInWAL))
10096

101-
// Make sure that the left `numPartitionssInBM` blocks are in block manager, and others are not
97+
// Make sure that the left `numPartitionsInBM` blocks are in block manager, and others are not
10298
require(
103-
blockIds.take(numPartitionssInBM).forall(blockManager.get(_).nonEmpty),
99+
blockIds.take(numPartitionsInBM).forall(blockManager.get(_).nonEmpty),
104100
"Expected blocks not in BlockManager"
105101
)
106102
require(
@@ -115,7 +111,7 @@ class WriteAheadLogBackedBlockRDDSuite extends FunSuite with BeforeAndAfterAll {
115111
"Expected blocks not in write ahead log"
116112
)
117113
require(
118-
segments.take(numPartitionssInBM).forall(s =>
114+
segments.take(numPartitionsInBM).forall(s =>
119115
!new File(s.path.stripPrefix("file://")).exists()),
120116
"Unexpected blocks in write ahead log"
121117
)

0 commit comments

Comments
 (0)