Skip to content

Commit 45ded64

Browse files
committed
run ./dev/scalafmt to reformat
1 parent 8844f3d commit 45ded64

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterSchedulerBackend.scala

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ private[spark] class KubernetesClusterSchedulerBackend(
4040
lifecycleEventHandler: ExecutorPodsLifecycleManager,
4141
watchEvents: ExecutorPodsWatchSnapshotSource,
4242
pollEvents: ExecutorPodsPollingSnapshotSource)
43-
extends CoarseGrainedSchedulerBackend(scheduler, sc.env.rpcEnv) {
43+
extends CoarseGrainedSchedulerBackend(scheduler, sc.env.rpcEnv) {
4444

45-
private implicit val requestExecutorContext = ExecutionContext.fromExecutorService(
46-
requestExecutorsService)
45+
private implicit val requestExecutorContext =
46+
ExecutionContext.fromExecutorService(requestExecutorsService)
4747

4848
protected override val minRegisteredRatio =
4949
if (conf.getOption("spark.scheduler.minRegisteredResourcesRatio").isEmpty) {
@@ -62,11 +62,12 @@ private[spark] class KubernetesClusterSchedulerBackend(
6262
}
6363

6464
/**
65-
* Get an application ID associated with the job.
66-
* This returns the string value of spark.app.id if set, otherwise
67-
* the locally-generated ID from the superclass.
68-
* @return The application ID
69-
*/
65+
* Get an application ID associated with the job.
66+
* This returns the string value of spark.app.id if set, otherwise
67+
* the locally-generated ID from the superclass.
68+
*
69+
* @return The application ID
70+
*/
7071
override def applicationId(): String = {
7172
conf.getOption("spark.app.id").map(_.toString).getOrElse(super.applicationId)
7273
}
@@ -99,7 +100,8 @@ private[spark] class KubernetesClusterSchedulerBackend(
99100

100101
if (shouldDeleteExecutors) {
101102
Utils.tryLogNonFatalError {
102-
kubernetesClient.pods()
103+
kubernetesClient
104+
.pods()
103105
.withLabel(SPARK_APP_ID_LABEL, applicationId())
104106
.withLabel(SPARK_ROLE_LABEL, SPARK_POD_EXECUTOR_ROLE)
105107
.delete()
@@ -131,7 +133,8 @@ private[spark] class KubernetesClusterSchedulerBackend(
131133
}
132134

133135
override def doKillExecutors(executorIds: Seq[String]): Future[Boolean] = Future[Boolean] {
134-
kubernetesClient.pods()
136+
kubernetesClient
137+
.pods()
135138
.withLabel(SPARK_APP_ID_LABEL, applicationId())
136139
.withLabel(SPARK_ROLE_LABEL, SPARK_POD_EXECUTOR_ROLE)
137140
.withLabelIn(SPARK_EXECUTOR_ID_LABEL, executorIds: _*)
@@ -144,7 +147,7 @@ private[spark] class KubernetesClusterSchedulerBackend(
144147
}
145148

146149
private class KubernetesDriverEndpoint(rpcEnv: RpcEnv, sparkProperties: Seq[(String, String)])
147-
extends DriverEndpoint(rpcEnv, sparkProperties) {
150+
extends DriverEndpoint(rpcEnv, sparkProperties) {
148151

149152
override def onDisconnected(rpcAddress: RpcAddress): Unit = {
150153
// Don't do anything besides disabling the executor - allow the Kubernetes API events to

resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterSchedulerBackendSuite.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class KubernetesClusterSchedulerBackendSuite extends SparkFunSuite with BeforeAn
3636

3737
private val requestExecutorsService = new DeterministicScheduler()
3838
private val sparkConf = new SparkConf(false)
39-
.set("spark.executor.instances", "3").set("spark.app.id", TEST_SPARK_APP_ID)
39+
.set("spark.executor.instances", "3")
40+
.set("spark.app.id", TEST_SPARK_APP_ID)
4041

4142
@Mock
4243
private var sc: SparkContext = _
@@ -87,8 +88,10 @@ class KubernetesClusterSchedulerBackendSuite extends SparkFunSuite with BeforeAn
8788
when(sc.env).thenReturn(env)
8889
when(env.rpcEnv).thenReturn(rpcEnv)
8990
driverEndpoint = ArgumentCaptor.forClass(classOf[RpcEndpoint])
90-
when(rpcEnv.setupEndpoint(
91-
mockitoEq(CoarseGrainedSchedulerBackend.ENDPOINT_NAME), driverEndpoint.capture()))
91+
when(
92+
rpcEnv.setupEndpoint(
93+
mockitoEq(CoarseGrainedSchedulerBackend.ENDPOINT_NAME),
94+
driverEndpoint.capture()))
9295
.thenReturn(driverEndpointRef)
9396
when(kubernetesClient.pods()).thenReturn(podOperations)
9497
schedulerBackendUnderTest = new KubernetesClusterSchedulerBackend(
@@ -125,8 +128,7 @@ class KubernetesClusterSchedulerBackendSuite extends SparkFunSuite with BeforeAn
125128

126129
test("Remove executor") {
127130
schedulerBackendUnderTest.start()
128-
schedulerBackendUnderTest.doRemoveExecutor(
129-
"1", ExecutorKilled)
131+
schedulerBackendUnderTest.doRemoveExecutor("1", ExecutorKilled)
130132
verify(driverEndpointRef).send(RemoveExecutor("1", ExecutorKilled))
131133
}
132134

0 commit comments

Comments
 (0)