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
0da2ff10
Commit
0da2ff10
authored
12 years ago
by
Tyson
Browse files
Options
Downloads
Patches
Plain Diff
Added url query parameter json and handler
parent
269fe018
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/scala/spark/deploy/master/MasterWebUI.scala
+14
-5
14 additions, 5 deletions
core/src/main/scala/spark/deploy/master/MasterWebUI.scala
core/src/main/scala/spark/deploy/worker/WorkerWebUI.scala
+15
-5
15 additions, 5 deletions
core/src/main/scala/spark/deploy/worker/WorkerWebUI.scala
with
29 additions
and
10 deletions
core/src/main/scala/spark/deploy/master/MasterWebUI.scala
+
14
−
5
View file @
0da2ff10
...
...
@@ -9,6 +9,9 @@ import cc.spray.Directives
import
cc.spray.directives._
import
cc.spray.typeconversion.TwirlSupport._
import
spark.deploy._
import
cc.spray.http.MediaTypes
import
JsonProtocol._
import
cc.spray.typeconversion.SprayJsonSupport._
private
[
spark
]
class
MasterWebUI
(
val
actorSystem
:
ActorSystem
,
master
:
ActorRef
)
extends
Directives
{
...
...
@@ -19,13 +22,19 @@ class MasterWebUI(val actorSystem: ActorSystem, master: ActorRef) extends Direct
val
handler
=
{
get
{
path
(
""
)
{
c
ompleteWith
{
(
path
(
""
)
&
parameters
(
'json
?))
{
c
ase
Some
(
js
)
=>
val
future
=
master
?
RequestMasterState
future
.
map
{
masterState
=>
spark
.
deploy
.
master
.
html
.
index
.
render
(
masterState
.
asInstanceOf
[
MasterState
])
respondWithMediaType
(
MediaTypes
.
`application/json`
)
{
ctx
=>
ctx
.
complete
(
future
.
mapTo
[
MasterState
])
}
case
None
=>
completeWith
{
val
future
=
master
?
RequestMasterState
future
.
map
{
masterState
=>
spark
.
deploy
.
master
.
html
.
index
.
render
(
masterState
.
asInstanceOf
[
MasterState
])
}
}
}
}
~
path
(
"job"
)
{
parameter
(
"jobId"
)
{
jobId
=>
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/spark/deploy/worker/WorkerWebUI.scala
+
15
−
5
View file @
0da2ff10
...
...
@@ -7,7 +7,10 @@ import akka.util.Timeout
import
akka.util.duration._
import
cc.spray.Directives
import
cc.spray.typeconversion.TwirlSupport._
import
spark.deploy.
{
WorkerState
,
RequestWorkerState
}
import
spark.deploy.
{
JsonProtocol
,
WorkerState
,
RequestWorkerState
}
import
cc.spray.http.MediaTypes
import
JsonProtocol._
import
cc.spray.typeconversion.SprayJsonSupport._
private
[
spark
]
class
WorkerWebUI
(
val
actorSystem
:
ActorSystem
,
worker
:
ActorRef
)
extends
Directives
{
...
...
@@ -18,13 +21,20 @@ class WorkerWebUI(val actorSystem: ActorSystem, worker: ActorRef) extends Direct
val
handler
=
{
get
{
path
(
""
)
{
c
ompleteWith
{
(
path
(
""
)
&
parameters
(
'json
?))
{
c
ase
Some
(
js
)
=>
{
val
future
=
worker
?
RequestWorkerState
future
.
map
{
workerState
=>
spark
.
deploy
.
worker
.
html
.
index
(
workerState
.
asInstanceOf
[
WorkerState
])
respondWithMediaType
(
MediaTypes
.
`application/json`
)
{
ctx
=>
ctx
.
complete
(
future
.
mapTo
[
WorkerState
])
}
}
case
None
=>
completeWith
{
val
future
=
worker
?
RequestWorkerState
future
.
map
{
workerState
=>
spark
.
deploy
.
worker
.
html
.
index
(
workerState
.
asInstanceOf
[
WorkerState
])
}
}
}
~
path
(
"log"
)
{
parameters
(
"jobId"
,
"executorId"
,
"logType"
)
{
(
jobId
,
executorId
,
logType
)
=>
...
...
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