Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
doujutun3207
flink
提交
6da093a6
F
flink
项目概览
doujutun3207
/
flink
与 Fork 源项目一致
从无法访问的项目Fork
通知
24
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flink
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6da093a6
编写于
3月 02, 2015
作者:
U
Ufuk Celebi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[distributed runtime] Notify about error when handing in channel
上级
256b2ee3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
16 deletion
+26
-16
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientFactory.java
...ntime/io/network/netty/PartitionRequestClientFactory.java
+26
-16
未找到文件。
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientFactory.java
浏览文件 @
6da093a6
...
...
@@ -52,20 +52,22 @@ class PartitionRequestClientFactory {
Object
entry
;
PartitionRequestClient
client
=
null
;
while
(
client
==
null
)
{
while
(
client
==
null
)
{
entry
=
clients
.
get
(
remoteAddress
);
if
(
entry
!=
null
)
{
// Existing channel or connecting channel
if
(
entry
instanceof
PartitionRequestClient
)
{
client
=
(
PartitionRequestClient
)
entry
;
}
else
{
}
else
{
ConnectingChannel
future
=
(
ConnectingChannel
)
entry
;
client
=
future
.
waitForChannel
();
clients
.
replace
(
remoteAddress
,
future
,
client
);
}
}
else
{
}
else
{
// No channel yet. Create one, but watch out for a race.
// We create a "connecting future" and atomically add it to the map.
// Only the thread that really added it establishes the channel.
...
...
@@ -79,18 +81,20 @@ class PartitionRequestClientFactory {
client
=
connectingChannel
.
waitForChannel
();
clients
.
replace
(
remoteAddress
,
connectingChannel
,
client
);
}
else
if
(
old
instanceof
ConnectingChannel
)
{
}
else
if
(
old
instanceof
ConnectingChannel
)
{
client
=
((
ConnectingChannel
)
old
).
waitForChannel
();
clients
.
replace
(
remoteAddress
,
old
,
client
);
}
else
{
}
else
{
client
=
(
PartitionRequestClient
)
old
;
}
}
// Make sure to increment the reference count before handing a client
// out to ensure correct bookkeeping for channel closing.
if
(!
client
.
incrementReferenceCounter
())
{
if
(!
client
.
incrementReferenceCounter
())
{
destroyPartitionRequestClient
(
remoteAddress
,
client
);
client
=
null
;
}
...
...
@@ -102,7 +106,7 @@ class PartitionRequestClientFactory {
public
void
closeOpenChannelConnections
(
RemoteAddress
remoteAddress
)
{
Object
entry
=
clients
.
get
(
remoteAddress
);
if
(
entry
instanceof
ConnectingChannel
)
{
if
(
entry
instanceof
ConnectingChannel
)
{
ConnectingChannel
channel
=
(
ConnectingChannel
)
entry
;
if
(
channel
.
dispose
())
{
...
...
@@ -141,8 +145,9 @@ class PartitionRequestClientFactory {
boolean
result
;
synchronized
(
connectLock
)
{
if
(
partitionRequestClient
!=
null
)
{
result
=
partitionRequestClient
.
disposeIfNotUsed
();
}
else
{
result
=
partitionRequestClient
.
disposeIfNotUsed
();
}
else
{
disposeRequestClient
=
true
;
result
=
true
;
}
...
...
@@ -155,16 +160,21 @@ class PartitionRequestClientFactory {
private
void
handInChannel
(
Channel
channel
)
{
synchronized
(
connectLock
)
{
PartitionRequestClientHandler
requestHandler
=
(
PartitionRequestClientHandler
)
channel
.
pipeline
().
get
(
PartitionRequestProtocol
.
CLIENT_REQUEST_HANDLER_NAME
);
try
{
PartitionRequestClientHandler
requestHandler
=
(
PartitionRequestClientHandler
)
channel
.
pipeline
().
get
(
PartitionRequestProtocol
.
CLIENT_REQUEST_HANDLER_NAME
);
partitionRequestClient
=
new
PartitionRequestClient
(
channel
,
requestHandler
,
remoteAddress
,
clientFactory
);
partitionRequestClient
=
new
PartitionRequestClient
(
channel
,
requestHandler
,
remoteAddress
,
clientFactory
);
if
(
disposeRequestClient
)
{
partitionRequestClient
.
disposeIfNotUsed
();
}
if
(
disposeRequestClient
)
{
partitionRequestClient
.
disposeIfNotUsed
();
}
connectLock
.
notifyAll
();
connectLock
.
notifyAll
();
}
catch
(
Throwable
t
)
{
notifyOfError
(
t
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录