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
a9481c35
Commit
a9481c35
authored
14 years ago
by
root
Browse files
Options
Downloads
Patches
Plain Diff
Update to work with latest Mesos API changes
parent
4488b3bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
run
+6
-1
6 additions, 1 deletion
run
src/scala/spark/MesosScheduler.scala
+9
-9
9 additions, 9 deletions
src/scala/spark/MesosScheduler.scala
third_party/mesos.jar
+0
-0
0 additions, 0 deletions
third_party/mesos.jar
with
15 additions
and
10 deletions
run
+
6
−
1
View file @
a9481c35
...
...
@@ -8,7 +8,12 @@ if [ -e $FWDIR/conf/spark-env.sh ] ; then
.
$FWDIR
/conf/spark-env.sh
fi
if
[
"
$SPARK_MEM
"
==
""
]
;
then
if
[
"x
$MESOS_HOME
"
!=
"x"
]
;
then
SPARK_CLASSPATH
=
"
$MESOS_HOME
/lib/java/mesos.jar:
$SPARK_CLASSPATH
"
SPARK_LIBRARY_PATH
=
"
$MESOS_HOME
/lib/java:
$SPARK_LIBARY_PATH
"
fi
if
[
"x
$SPARK_MEM
"
==
"x"
]
;
then
SPARK_MEM
=
"300m"
fi
...
...
This diff is collapsed.
Click to expand it.
src/scala/spark/MesosScheduler.scala
+
9
−
9
View file @
a9481c35
...
...
@@ -100,9 +100,9 @@ extends NScheduler with spark.Scheduler
}
override
def
resourceOffer
(
d
:
SchedulerDriver
,
oid
:
String
,
offers
:
SlaveOffer
Vector
)
{
d
:
SchedulerDriver
,
oid
:
String
,
offers
:
java.util.List
[
SlaveOffer
]
)
{
synchronized
{
val
tasks
=
new
TaskDescription
Vector
val
tasks
=
new
java
.
util
.
ArrayList
[
TaskDescription
]
if
(
activeOp
!=
null
)
{
try
{
for
(
i
<-
0
until
offers
.
size
.
toInt
)
{
...
...
@@ -115,8 +115,8 @@ extends NScheduler with spark.Scheduler
case
e
:
Exception
=>
e
.
printStackTrace
}
}
val
params
=
new
StringMap
params
.
se
t
(
"timeout"
,
"1"
)
val
params
=
new
java
.
util
.
HashMap
[
String
,
String
]
params
.
pu
t
(
"timeout"
,
"1"
)
d
.
replyToOffer
(
oid
,
tasks
,
params
)
// TODO: use smaller timeout
}
}
...
...
@@ -212,9 +212,9 @@ extends ParallelOperation
checkPrefVals
=
Array
(
true
,
false
)
// Allow non-preferred tasks
// TODO: Make desiredCpus and desiredMem configurable
val
desiredCpus
=
1
val
desiredMem
=
750
L
*
1024L
*
1024L
val
desiredMem
=
750
if
(
offer
.
getParams
.
get
(
"cpus"
).
toInt
<
desiredCpus
||
offer
.
getParams
.
get
(
"mem"
).
to
Long
<
desiredMem
)
offer
.
getParams
.
get
(
"mem"
).
to
Int
<
desiredMem
)
return
None
for
(
checkPref
<-
checkPrefVals
;
i
<-
0
until
numTasks
)
{
if
(!
launched
(
i
)
&&
(!
checkPref
||
...
...
@@ -231,9 +231,9 @@ extends ParallelOperation
tasksLaunched
+=
1
if
(
checkPref
)
lastPreferredLaunchTime
=
time
val
params
=
new
StringMap
params
.
se
t
(
"cpus"
,
""
+
desiredCpus
)
params
.
se
t
(
"mem"
,
""
+
desiredMem
)
val
params
=
new
java
.
util
.
HashMap
[
String
,
String
]
params
.
pu
t
(
"cpus"
,
""
+
desiredCpus
)
params
.
pu
t
(
"mem"
,
""
+
desiredMem
)
val
serializedTask
=
Utils
.
serialize
(
tasks
(
i
))
return
Some
(
new
TaskDescription
(
taskId
,
offer
.
getSlaveId
,
"task_"
+
taskId
,
params
,
serializedTask
))
...
...
This diff is collapsed.
Click to expand it.
third_party/mesos.jar
+
0
−
0
View file @
a9481c35
No preview for this file type
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