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
7cf13709
Commit
7cf13709
authored
11 years ago
by
Reynold Xin
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:mridulm/spark
parents
084df858
0f45477b
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
.gitignore
+0
-2
0 additions, 2 deletions
.gitignore
core/src/main/scala/spark/network/ConnectionManager.scala
+55
-25
55 additions, 25 deletions
core/src/main/scala/spark/network/ConnectionManager.scala
with
55 additions
and
27 deletions
.gitignore
+
0
−
2
View file @
7cf13709
...
@@ -29,8 +29,6 @@ project/build/target/
...
@@ -29,8 +29,6 @@ project/build/target/
project/plugins/target/
project/plugins/target/
project/plugins/lib_managed/
project/plugins/lib_managed/
project/plugins/src_managed/
project/plugins/src_managed/
logs/
log/
spark-tests.log
spark-tests.log
streaming-tests.log
streaming-tests.log
dependency-reduced-pom.xml
dependency-reduced-pom.xml
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/spark/network/ConnectionManager.scala
+
55
−
25
View file @
7cf13709
...
@@ -254,7 +254,32 @@ private[spark] class ConnectionManager(port: Int) extends Logging {
...
@@ -254,7 +254,32 @@ private[spark] class ConnectionManager(port: Int) extends Logging {
}
}
}
}
val
selectedKeysCount
=
selector
.
select
()
val
selectedKeysCount
=
try
{
selector
.
select
()
}
catch
{
case
e
:
CancelledKeyException
=>
{
// Some keys within the selectors list are invalid/closed. clear them.
val
allKeys
=
selector
.
keys
().
iterator
()
while
(
allKeys
.
hasNext
())
{
val
key
=
allKeys
.
next
()
try
{
if
(!
key
.
isValid
)
{
logInfo
(
"Key not valid ? "
+
key
)
throw
new
CancelledKeyException
()
}
}
catch
{
case
e
:
CancelledKeyException
=>
{
logInfo
(
"key already cancelled ? "
+
key
,
e
)
triggerForceCloseByException
(
key
,
e
)
}
}
}
}
0
}
if
(
selectedKeysCount
==
0
)
{
if
(
selectedKeysCount
==
0
)
{
logDebug
(
"Selector selected "
+
selectedKeysCount
+
" of "
+
selector
.
keys
.
size
+
" keys"
)
logDebug
(
"Selector selected "
+
selectedKeysCount
+
" of "
+
selector
.
keys
.
size
+
" keys"
)
}
}
...
@@ -262,31 +287,36 @@ private[spark] class ConnectionManager(port: Int) extends Logging {
...
@@ -262,31 +287,36 @@ private[spark] class ConnectionManager(port: Int) extends Logging {
logInfo
(
"Selector thread was interrupted!"
)
logInfo
(
"Selector thread was interrupted!"
)
return
return
}
}
val
selectedKeys
=
selector
.
selectedKeys
().
iterator
()
if
(
0
!=
selectedKeysCount
)
{
while
(
selectedKeys
.
hasNext
())
{
val
selectedKeys
=
selector
.
selectedKeys
().
iterator
()
val
key
=
selectedKeys
.
next
while
(
selectedKeys
.
hasNext
())
{
selectedKeys
.
remove
()
val
key
=
selectedKeys
.
next
try
{
selectedKeys
.
remove
()
if
(
key
.
isValid
)
{
try
{
if
(
key
.
isAcceptable
)
{
if
(
key
.
isValid
)
{
acceptConnection
(
key
)
if
(
key
.
isAcceptable
)
{
}
else
acceptConnection
(
key
)
if
(
key
.
isConnectable
)
{
}
else
triggerConnect
(
key
)
if
(
key
.
isConnectable
)
{
}
else
triggerConnect
(
key
)
if
(
key
.
isReadable
)
{
}
else
triggerRead
(
key
)
if
(
key
.
isReadable
)
{
}
else
triggerRead
(
key
)
if
(
key
.
isWritable
)
{
}
else
triggerWrite
(
key
)
if
(
key
.
isWritable
)
{
triggerWrite
(
key
)
}
}
else
{
logInfo
(
"Key not valid ? "
+
key
)
throw
new
CancelledKeyException
()
}
}
catch
{
// weird, but we saw this happening - even though key.isValid was true, key.isAcceptable would throw CancelledKeyException.
case
e
:
CancelledKeyException
=>
{
logInfo
(
"key already cancelled ? "
+
key
,
e
)
triggerForceCloseByException
(
key
,
e
)
}
}
}
}
catch
{
// weird, but we saw this happening - even though key.isValid was true, key.isAcceptable would throw CancelledKeyException.
case
e
:
CancelledKeyException
=>
{
logInfo
(
"key already cancelled ? "
+
key
,
e
)
triggerForceCloseByException
(
key
,
e
)
}
}
}
}
}
}
...
...
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