@@ -76,31 +76,27 @@ class WriteAheadLogBackedBlockRDDSuite extends FunSuite with BeforeAndAfterAll {
76
76
* and the rest to a write ahead log, and then reading reading it all back using the RDD.
77
77
* It can also test if the partitions that were read from the log were again stored in
78
78
* 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
80
80
* @param numPartitionsInWAL Number of partitions to write to the Write Ahead Log
81
81
* @param testStoreInBM Test whether blocks read from log are stored back into block manager
82
82
*/
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
89
85
val data = Seq .fill(numBlocks, 10 )(scala.util.Random .nextString(50 ))
90
86
91
87
// Put the necessary blocks in the block manager
92
88
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) =>
94
90
blockManager.putIterator(blockId, block.iterator, StorageLevel .MEMORY_ONLY_SER )
95
91
}
96
92
97
93
// Generate write ahead log segments
98
- val segments = generateFakeSegments(numPartitionssInBM ) ++
94
+ val segments = generateFakeSegments(numPartitionsInBM ) ++
99
95
writeLogSegments(data.takeRight(numPartitionsInWAL), blockIds.takeRight(numPartitionsInWAL))
100
96
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
102
98
require(
103
- blockIds.take(numPartitionssInBM ).forall(blockManager.get(_).nonEmpty),
99
+ blockIds.take(numPartitionsInBM ).forall(blockManager.get(_).nonEmpty),
104
100
" Expected blocks not in BlockManager"
105
101
)
106
102
require(
@@ -115,7 +111,7 @@ class WriteAheadLogBackedBlockRDDSuite extends FunSuite with BeforeAndAfterAll {
115
111
" Expected blocks not in write ahead log"
116
112
)
117
113
require(
118
- segments.take(numPartitionssInBM ).forall(s =>
114
+ segments.take(numPartitionsInBM ).forall(s =>
119
115
! new File (s.path.stripPrefix(" file://" )).exists()),
120
116
" Unexpected blocks in write ahead log"
121
117
)
0 commit comments