Skip to content

Commit

Permalink
Style fix ups
Browse files Browse the repository at this point in the history
  • Loading branch information
tgravescs committed Jan 21, 2020
1 parent c3358fc commit 35e0a4d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.spark.deploy.history

import org.apache.spark.{SparkFunSuite, Success, TaskResultLost, TaskState}

import org.apache.spark.executor.{ExecutorMetrics, TaskMetrics}
import org.apache.spark.resource.ResourceProfile
import org.apache.spark.scheduler._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import org.mockito.Mockito.when
import org.mockito.invocation.InvocationOnMock
import org.scalatest.concurrent.Eventually
import org.scalatestplus.mockito.MockitoSugar._
import org.apache.spark._

import org.apache.spark._
import org.apache.spark.internal.config._
import org.apache.spark.internal.config.Network.RPC_MESSAGE_MAX_SIZE
import org.apache.spark.rdd.RDD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import scala.collection.immutable.Map
import scala.reflect.{classTag, ClassTag}

import org.scalatest.BeforeAndAfter
import org.apache.spark._

import org.apache.spark._
import org.apache.spark.executor.{ExecutorMetrics, TaskMetrics}
import org.apache.spark.internal.config.Status._
import org.apache.spark.metrics.ExecutorMetricType
Expand Down Expand Up @@ -152,8 +152,10 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter {
// Start a job with 2 stages / 4 tasks each
time += 1
val stages = Seq(
new StageInfo(1, 0, "stage1", 4, Nil, Nil, "details1", resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID),
new StageInfo(2, 0, "stage2", 4, Nil, Seq(1), "details2", resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID))
new StageInfo(1, 0, "stage1", 4, Nil, Nil, "details1",
resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID),
new StageInfo(2, 0, "stage2", 4, Nil, Seq(1), "details2",
resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID))

val jobProps = new Properties()
jobProps.setProperty(SparkContext.SPARK_JOB_DESCRIPTION, "jobDescription")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ object ListenerEventsTestHelper {
/** Create a stage submitted event for the specified stage Id. */
def createStageSubmittedEvent(stageId: Int): SparkListenerStageSubmitted = {
SparkListenerStageSubmitted(new StageInfo(stageId, 0, stageId.toString, 0,
Seq.empty, Seq.empty, "details", resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID))
Seq.empty, Seq.empty, "details",
resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID))
}

/** Create a stage completed event for the specified stage Id. */
def createStageCompletedEvent(stageId: Int): SparkListenerStageCompleted = {
SparkListenerStageCompleted(new StageInfo(stageId, 0, stageId.toString, 0,
Seq.empty, Seq.empty, "details", resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID))
Seq.empty, Seq.empty, "details",
resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID))
}

def createExecutorAddedEvent(executorId: Int): SparkListenerExecutorAdded = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.apache.spark.internal.config.Status._
import org.apache.spark.resource.ResourceProfile
import org.apache.spark.scheduler._
import org.apache.spark.status.AppStatusStore
import org.apache.spark.status.api.v1.{StageData, StageStatus, AccumulableInfo => UIAccumulableInfo}
import org.apache.spark.status.api.v1.{AccumulableInfo => UIAccumulableInfo, StageData, StageStatus}
import org.apache.spark.ui.jobs.{ApiHelper, StagePage, StagesTab, TaskPagedTable}

class StagePageSuite extends SparkFunSuite with LocalSparkContext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ class ExecutorAllocationManagerSuite extends TestSuiteBase
when(allocationClient.getExecutorIds()).thenReturn((1 to numExecs).map(_.toString))
requestExecutors(allocationManager, numNewExecs)
val defaultProfId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID
verify(allocationClient, times(1)).requestTotalExecutors(meq(Map(defaultProfId -> expectedRequestedTotalExecs)), meq(Map(defaultProfId -> 0)), meq(Map.empty))
verify(allocationClient, times(1)).
requestTotalExecutors(
meq(Map(defaultProfId -> expectedRequestedTotalExecs)),
meq(Map(defaultProfId -> 0)), meq(Map.empty))
}

withAllocationManager(numReceivers = 1) { case (_, allocationManager) =>
Expand Down

0 comments on commit 35e0a4d

Please sign in to comment.