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
560e44a8
Commit
560e44a8
authored
11 years ago
by
Prashant Sharma
Browse files
Options
Downloads
Patches
Plain Diff
Restored master address for client.
parent
d092a8cc
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/org/apache/spark/deploy/client/Client.scala
+7
-4
7 additions, 4 deletions
...rc/main/scala/org/apache/spark/deploy/client/Client.scala
core/src/main/scala/org/apache/spark/deploy/master/Master.scala
+2
-2
2 additions, 2 deletions
...rc/main/scala/org/apache/spark/deploy/master/Master.scala
with
9 additions
and
6 deletions
core/src/main/scala/org/apache/spark/deploy/client/Client.scala
+
7
−
4
View file @
560e44a8
...
...
@@ -27,7 +27,7 @@ import akka.pattern.AskTimeoutException
import
akka.pattern.ask
import
akka.remote.
{
RemotingLifecycleEvent
,
DisassociatedEvent
,
AssociationErrorEvent
}
import
org.apache.spark.Logging
import
org.apache.spark.
{
SparkException
,
Logging
}
import
org.apache.spark.deploy.
{
ApplicationDescription
,
ExecutorState
}
import
org.apache.spark.deploy.DeployMessages._
import
org.apache.spark.deploy.master.Master
...
...
@@ -49,7 +49,7 @@ private[spark] class Client(
val
REGISTRATION_TIMEOUT
=
20.
seconds
val
REGISTRATION_RETRIES
=
3
var
prevMaster
:
ActorRef
=
null
// set for unwatching, when it fails.
var
masterAddress
:
Address
=
null
var
actor
:
ActorRef
=
null
var
appId
:
String
=
null
var
registered
=
false
...
...
@@ -103,11 +103,14 @@ private[spark] class Client(
def
changeMaster
(
url
:
String
)
{
activeMasterUrl
=
url
master
=
context
.
actorSelection
(
Master
.
toAkkaUrl
(
activeMasterUrl
))
masterAddress
=
activeMasterUrl
match
{
case
Master
.
sparkUrlRegex
(
host
,
port
)
=>
Address
(
"akka.tcp"
,
Master
.
systemName
,
host
,
port
.
toInt
)
case
x
=>
throw
new
SparkException
(
"Invalid spark URL:"
+
x
)
}
}
override
def
receive
=
{
case
RegisteredApplication
(
appId_
,
masterUrl
)
=>
prevMaster
=
sender
appId
=
appId_
registered
=
true
changeMaster
(
masterUrl
)
...
...
@@ -137,7 +140,7 @@ private[spark] class Client(
alreadyDisconnected
=
false
sender
!
MasterChangeAcknowledged
(
appId
)
case
DisassociatedEvent
(
_
,
address
,
_
)
=>
case
DisassociatedEvent
(
_
,
address
,
_
)
if
address
==
masterAddress
=>
logWarning
(
s
"Connection to $address failed; waiting for master to reconnect..."
)
markDisconnected
()
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/org/apache/spark/deploy/master/Master.scala
+
2
−
2
View file @
560e44a8
...
...
@@ -517,9 +517,9 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act
}
private
[
spark
]
object
Master
{
private
val
systemName
=
"sparkMaster"
val
systemName
=
"sparkMaster"
private
val
actorName
=
"Master"
private
val
sparkUrlRegex
=
"spark://([^:]+):([0-9]+)"
.
r
val
sparkUrlRegex
=
"spark://([^:]+):([0-9]+)"
.
r
def
main
(
argStrings
:
Array
[
String
])
{
val
args
=
new
MasterArguments
(
argStrings
)
...
...
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