Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
repair scalastyle check failures
  • Loading branch information
yaooqinn committed Nov 9, 2015
commit d17e989d2d3f73e93984d9d28fe2d71fea6b5bb1
14 changes: 10 additions & 4 deletions core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ private[spark] class MapStatusTrackingNoEmptyBlocks private (
}

private[spark] object MapStatusTrackingNoEmptyBlocks {
def apply(loc: BlockManagerId, numNonEmptyBlocks: Int , nonEmptyBlocks: mutable.HashSet[Int], avgSize: Long): MapStatusTrackingNoEmptyBlocks =
{
def apply(
loc: BlockManagerId,
numNonEmptyBlocks: Int,
nonEmptyBlocks: mutable.HashSet[Int],
avgSize: Long): MapStatusTrackingNoEmptyBlocks = {
new MapStatusTrackingNoEmptyBlocks(loc, numNonEmptyBlocks, nonEmptyBlocks, avgSize )
}
}
Expand Down Expand Up @@ -227,8 +230,11 @@ private[spark] class MapStatusTrackingEmptyBlocks private (
}

private[spark] object MapStatusTrackingEmptyBlocks {
def apply(loc: BlockManagerId, numNonEmptyBlocks: Int , emptyBlocksHashSet: mutable.HashSet[Int], avgSize: Long): MapStatusTrackingEmptyBlocks =
{
def apply(
loc: BlockManagerId,
numNonEmptyBlocks: Int ,
emptyBlocksHashSet: mutable.HashSet[Int],
avgSize: Long): MapStatusTrackingEmptyBlocks = {
new MapStatusTrackingEmptyBlocks(loc, numNonEmptyBlocks, emptyBlocksHashSet, avgSize )
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class MapStatusSuite extends SparkFunSuite {
}
}

test("large tasks with dense non-empty blocks should use " + classOf[MapStatusTrackingEmptyBlocks].getName) {
test("large tasks with dense non-empty blocks should use" +
classOf[MapStatusTrackingEmptyBlocks].getName) {
val sizes = Array.fill[Long](2001)(150L)
val status = MapStatus(null, sizes)
assert(status.isInstanceOf[MapStatusTrackingEmptyBlocks])
Expand All @@ -76,7 +77,8 @@ class MapStatusSuite extends SparkFunSuite {
assert(status.getSizeForBlock(2000) === 150L)
}

test("large tasks with sparse non-empty blocks should use " + classOf[MapStatusTrackingNoEmptyBlocks].getName) {
test("large tasks with sparse non-empty blocks should use " +
classOf[MapStatusTrackingNoEmptyBlocks].getName) {
val sizes = Array.fill[Long](2001)(0L)
sizes(0) = 1L
val status = MapStatus(null, sizes)
Expand All @@ -87,10 +89,11 @@ class MapStatusSuite extends SparkFunSuite {
assert(status.getSizeForBlock(2000) === 0L)
}

test("large tasks with not dense or sparse non-empty blocks should use " + classOf[HighlyCompressedMapStatus].getName) {
test("large tasks with not dense or sparse non-empty blocks should use " +
classOf[HighlyCompressedMapStatus].getName) {
val sizes = Array.fill[Long](2001)(0L)
for(i <- 0 to sizes.length - 1){
if(i % 2 == 1){
if (i % 2 == 1) {
sizes(i) = 1L
}
}
Expand Down