-
Notifications
You must be signed in to change notification settings - Fork 28.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-9202] capping maximum number of executor&driver information ke…
…pt in Worker https://issues.apache.org/jira/browse/SPARK-9202 Author: CodingCat <zhunansjtu@gmail.com> Closes #7714 from CodingCat/SPARK-9202 and squashes the following commits: 23977fb [CodingCat] add comments about why we don't synchronize finishedExecutors & finishedDrivers dc9772d [CodingCat] addressing the comments e125241 [CodingCat] stylistic fix 80bfe52 [CodingCat] fix JsonProtocolSuite d7d9485 [CodingCat] styistic fix and respect insert ordering 031755f [CodingCat] add license info & stylistic fix c3b5361 [CodingCat] test cases and docs c557b3a [CodingCat] applications are fine 9cac751 [CodingCat] application is fine... ad87ed7 [CodingCat] trimFinishedExecutorsAndDrivers
- Loading branch information
Showing
6 changed files
with
329 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
core/src/test/scala/org/apache/spark/deploy/DeployTestUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.spark.deploy | ||
|
||
import java.io.File | ||
import java.util.Date | ||
|
||
import org.apache.spark.deploy.master.{ApplicationInfo, DriverInfo, WorkerInfo} | ||
import org.apache.spark.deploy.worker.{DriverRunner, ExecutorRunner} | ||
import org.apache.spark.{SecurityManager, SparkConf} | ||
|
||
private[deploy] object DeployTestUtils { | ||
def createAppDesc(): ApplicationDescription = { | ||
val cmd = new Command("mainClass", List("arg1", "arg2"), Map(), Seq(), Seq(), Seq()) | ||
new ApplicationDescription("name", Some(4), 1234, cmd, "appUiUrl") | ||
} | ||
|
||
def createAppInfo() : ApplicationInfo = { | ||
val appInfo = new ApplicationInfo(JsonConstants.appInfoStartTime, | ||
"id", createAppDesc(), JsonConstants.submitDate, null, Int.MaxValue) | ||
appInfo.endTime = JsonConstants.currTimeInMillis | ||
appInfo | ||
} | ||
|
||
def createDriverCommand(): Command = new Command( | ||
"org.apache.spark.FakeClass", Seq("some arg --and-some options -g foo"), | ||
Map(("K1", "V1"), ("K2", "V2")), Seq("cp1", "cp2"), Seq("lp1", "lp2"), Seq("-Dfoo") | ||
) | ||
|
||
def createDriverDesc(): DriverDescription = | ||
new DriverDescription("hdfs://some-dir/some.jar", 100, 3, false, createDriverCommand()) | ||
|
||
def createDriverInfo(): DriverInfo = new DriverInfo(3, "driver-3", | ||
createDriverDesc(), new Date()) | ||
|
||
def createWorkerInfo(): WorkerInfo = { | ||
val workerInfo = new WorkerInfo("id", "host", 8080, 4, 1234, null, 80, "publicAddress") | ||
workerInfo.lastHeartbeat = JsonConstants.currTimeInMillis | ||
workerInfo | ||
} | ||
|
||
def createExecutorRunner(execId: Int): ExecutorRunner = { | ||
new ExecutorRunner( | ||
"appId", | ||
execId, | ||
createAppDesc(), | ||
4, | ||
1234, | ||
null, | ||
"workerId", | ||
"host", | ||
123, | ||
"publicAddress", | ||
new File("sparkHome"), | ||
new File("workDir"), | ||
"akka://worker", | ||
new SparkConf, | ||
Seq("localDir"), | ||
ExecutorState.RUNNING) | ||
} | ||
|
||
def createDriverRunner(driverId: String): DriverRunner = { | ||
val conf = new SparkConf() | ||
new DriverRunner( | ||
conf, | ||
driverId, | ||
new File("workDir"), | ||
new File("sparkHome"), | ||
createDriverDesc(), | ||
null, | ||
"akka://worker", | ||
new SecurityManager(conf)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.