Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
c6be4ffb
Commit
c6be4ffb
authored
12 years ago
by
Matei Zaharia
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to CoarseMesosScheduler
parent
3a58efa5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/spark/scheduler/mesos/CoarseMesosScheduler.scala
+12
-8
12 additions, 8 deletions
...in/scala/spark/scheduler/mesos/CoarseMesosScheduler.scala
with
12 additions
and
8 deletions
core/src/main/scala/spark/scheduler/mesos/CoarseMesosScheduler.scala
+
12
−
8
View file @
c6be4ffb
...
...
@@ -64,7 +64,7 @@ class CoarseMesosScheduler(
def
receive
=
{
case
RegisterSlave
(
slaveId
,
host
)
=>
slaveActor
(
slaveId
)
=
sender
logInfo
(
"
Slave actor: "
+
sender
)
logInfo
(
"
Registered slave: "
+
sender
+
" with ID "
+
slaveId
)
slaveHost
(
slaveId
)
=
host
freeCores
(
slaveId
)
=
coresPerSlave
makeFakeOffers
()
...
...
@@ -96,7 +96,7 @@ class CoarseMesosScheduler(
}
}
val
masterActor
:
ActorRef
=
actorSystem
.
actorOf
(
Props
[
MasterActor
]
,
name
=
actorName
)
val
masterActor
:
ActorRef
=
actorSystem
.
actorOf
(
Props
(
new
MasterActor
)
,
name
=
actorName
)
val
taskIdsOnSlave
=
new
HashMap
[
String
,
HashSet
[
String
]]
...
...
@@ -284,24 +284,28 @@ class WorkerTask(slaveId: String, host: String) extends Task[Unit](-1) {
generation
=
0
def
run
(
id
:
Int
)
:
Unit
=
{
val
actorSystem
=
SparkEnv
.
get
.
actorSystem
val
actor
=
actorSystem
.
actorOf
(
Props
(
new
WorkerActor
(
slaveId
,
host
)),
name
=
"WorkerActor"
)
val
env
=
SparkEnv
.
get
val
classLoader
=
currentThread
.
getContextClassLoader
val
actor
=
env
.
actorSystem
.
actorOf
(
Props
(
new
WorkerActor
(
slaveId
,
host
,
env
,
classLoader
)),
name
=
"WorkerActor"
)
// Wait forever so that our Mesos task doesn't end
while
(
true
)
{
Thread
.
sleep
(
10000
)
}
}
}
class
WorkerActor
(
slaveId
:
String
,
host
:
String
)
e
xtends
Actor
with
Logging
{
val
env
=
SparkEnv
.
get
val
classLoader
=
currentThread
.
getContextClassLoader
class
WorkerActor
(
slaveId
:
String
,
host
:
String
,
e
nv
:
SparkEnv
,
classLoader
:
ClassLoader
)
extends
Actor
with
Logging
{
val
threadPool
=
new
ThreadPoolExecutor
(
1
,
128
,
600
,
TimeUnit
.
SECONDS
,
new
SynchronousQueue
[
Runnable
])
val
masterIp
:
String
=
System
.
getProperty
(
"spark.master.host"
,
"localhost"
)
val
masterPort
:
Int
=
System
.
getProperty
(
"spark.master.port"
,
"7077"
).
toInt
val
masterActor
=
env
.
actorSystem
.
actorFor
(
"akka://spark@%s:%s/%s"
.
format
(
masterIp
,
masterPort
,
"CoarseMesosScheduler"
))
"akka://spark@%s:%s/
user/
%s"
.
format
(
masterIp
,
masterPort
,
"CoarseMesosScheduler"
))
class
TaskRunner
(
desc
:
MTaskInfo
)
extends
Runnable
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment