Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Forever310
druid
提交
382cde9c
D
druid
项目概览
Forever310
/
druid
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
druid
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
382cde9c
编写于
7月 29, 2014
作者:
F
fjy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
less verbose logging for LQP
上级
7aef4634
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
35 deletion
+37
-35
server/src/main/java/io/druid/server/coordinator/LoadQueuePeon.java
.../main/java/io/druid/server/coordinator/LoadQueuePeon.java
+37
-35
未找到文件。
server/src/main/java/io/druid/server/coordinator/LoadQueuePeon.java
浏览文件 @
382cde9c
...
...
@@ -87,7 +87,7 @@ public class LoadQueuePeon
private
final
Object
lock
=
new
Object
();
private
volatile
SegmentHolder
currently
Load
ing
=
null
;
private
volatile
SegmentHolder
currently
Process
ing
=
null
;
LoadQueuePeon
(
CuratorFramework
curator
,
...
...
@@ -156,10 +156,10 @@ public class LoadQueuePeon
)
{
synchronized
(
lock
)
{
if
((
currently
Load
ing
!=
null
)
&&
currently
Load
ing
.
getSegmentIdentifier
().
equals
(
segment
.
getIdentifier
()))
{
if
((
currently
Process
ing
!=
null
)
&&
currently
Process
ing
.
getSegmentIdentifier
().
equals
(
segment
.
getIdentifier
()))
{
if
(
callback
!=
null
)
{
currently
Load
ing
.
addCallback
(
callback
);
currently
Process
ing
.
addCallback
(
callback
);
}
return
;
}
...
...
@@ -170,13 +170,13 @@ public class LoadQueuePeon
synchronized
(
lock
)
{
if
(
segmentsToLoad
.
contains
(
holder
))
{
if
((
callback
!=
null
))
{
currently
Load
ing
.
addCallback
(
callback
);
currently
Process
ing
.
addCallback
(
callback
);
}
return
;
}
}
log
.
info
(
"Asking server peon[%s] to load segment[%s]"
,
basePath
,
segment
);
log
.
info
(
"Asking server peon[%s] to load segment[%s]"
,
basePath
,
segment
.
getIdentifier
()
);
queuedSize
.
addAndGet
(
segment
.
getSize
());
segmentsToLoad
.
add
(
holder
);
doNext
();
...
...
@@ -188,10 +188,10 @@ public class LoadQueuePeon
)
{
synchronized
(
lock
)
{
if
((
currently
Load
ing
!=
null
)
&&
currently
Load
ing
.
getSegmentIdentifier
().
equals
(
segment
.
getIdentifier
()))
{
if
((
currently
Process
ing
!=
null
)
&&
currently
Process
ing
.
getSegmentIdentifier
().
equals
(
segment
.
getIdentifier
()))
{
if
(
callback
!=
null
)
{
currently
Load
ing
.
addCallback
(
callback
);
currently
Process
ing
.
addCallback
(
callback
);
}
return
;
}
...
...
@@ -202,7 +202,7 @@ public class LoadQueuePeon
synchronized
(
lock
)
{
if
(
segmentsToDrop
.
contains
(
holder
))
{
if
(
callback
!=
null
)
{
currently
Load
ing
.
addCallback
(
callback
);
currently
Process
ing
.
addCallback
(
callback
);
}
return
;
}
...
...
@@ -216,13 +216,13 @@ public class LoadQueuePeon
private
void
doNext
()
{
synchronized
(
lock
)
{
if
(
currently
Load
ing
==
null
)
{
if
(
currently
Process
ing
==
null
)
{
if
(!
segmentsToDrop
.
isEmpty
())
{
currently
Load
ing
=
segmentsToDrop
.
first
();
log
.
info
(
"Server[%s] dropping [%s]"
,
basePath
,
currently
Loading
);
currently
Process
ing
=
segmentsToDrop
.
first
();
log
.
info
(
"Server[%s] dropping [%s]"
,
basePath
,
currently
Processing
.
getSegmentIdentifier
()
);
}
else
if
(!
segmentsToLoad
.
isEmpty
())
{
currently
Load
ing
=
segmentsToLoad
.
first
();
log
.
info
(
"Server[%s] loading [%s]"
,
basePath
,
currently
Loading
);
currently
Process
ing
=
segmentsToLoad
.
first
();
log
.
info
(
"Server[%s] loading [%s]"
,
basePath
,
currently
Processing
.
getSegmentIdentifier
()
);
}
else
{
return
;
}
...
...
@@ -235,16 +235,16 @@ public class LoadQueuePeon
{
synchronized
(
lock
)
{
try
{
if
(
currently
Load
ing
==
null
)
{
if
(
currently
Process
ing
==
null
)
{
log
.
makeAlert
(
"Crazy race condition! server[%s]"
,
basePath
)
.
emit
();
actionCompleted
();
doNext
();
return
;
}
log
.
info
(
"Server[%s]
adding segment[%s]"
,
basePath
,
currentlyLoad
ing
.
getSegmentIdentifier
());
final
String
path
=
ZKPaths
.
makePath
(
basePath
,
currently
Load
ing
.
getSegmentIdentifier
());
final
byte
[]
payload
=
jsonMapper
.
writeValueAsBytes
(
currently
Load
ing
.
getChangeRequest
());
log
.
info
(
"Server[%s]
processing segment[%s]"
,
basePath
,
currentlyProcess
ing
.
getSegmentIdentifier
());
final
String
path
=
ZKPaths
.
makePath
(
basePath
,
currently
Process
ing
.
getSegmentIdentifier
());
final
byte
[]
payload
=
jsonMapper
.
writeValueAsBytes
(
currently
Process
ing
.
getChangeRequest
());
curator
.
create
().
withMode
(
CreateMode
.
EPHEMERAL
).
forPath
(
path
,
payload
);
zkWritingExecutor
.
schedule
(
...
...
@@ -255,7 +255,7 @@ public class LoadQueuePeon
{
try
{
if
(
curator
.
checkExists
().
forPath
(
path
)
!=
null
)
{
failAssign
(
new
ISE
(
"%s was never removed! Failing this
assig
n!"
,
path
));
failAssign
(
new
ISE
(
"%s was never removed! Failing this
operatio
n!"
,
path
));
}
}
catch
(
Exception
e
)
{
...
...
@@ -311,7 +311,9 @@ public class LoadQueuePeon
);
}
else
{
log
.
info
(
"Server[%s] skipping doNext() because something is currently loading[%s]."
,
basePath
,
currentlyLoading
"Server[%s] skipping doNext() because something is currently loading[%s]."
,
basePath
,
currentlyProcessing
.
getSegmentIdentifier
()
);
}
}
...
...
@@ -319,29 +321,29 @@ public class LoadQueuePeon
private
void
actionCompleted
()
{
if
(
currently
Load
ing
!=
null
)
{
switch
(
currently
Load
ing
.
getType
())
{
if
(
currently
Process
ing
!=
null
)
{
switch
(
currently
Process
ing
.
getType
())
{
case
LOAD:
segmentsToLoad
.
remove
(
currently
Load
ing
);
queuedSize
.
addAndGet
(-
currently
Load
ing
.
getSegmentSize
());
segmentsToLoad
.
remove
(
currently
Process
ing
);
queuedSize
.
addAndGet
(-
currently
Process
ing
.
getSegmentSize
());
break
;
case
DROP:
segmentsToDrop
.
remove
(
currently
Load
ing
);
segmentsToDrop
.
remove
(
currently
Process
ing
);
break
;
default
:
throw
new
UnsupportedOperationException
();
}
currently
Load
ing
.
executeCallbacks
();
currently
Load
ing
=
null
;
currently
Process
ing
.
executeCallbacks
();
currently
Process
ing
=
null
;
}
}
public
void
stop
()
{
synchronized
(
lock
)
{
if
(
currently
Load
ing
!=
null
)
{
currently
Load
ing
.
executeCallbacks
();
currently
Load
ing
=
null
;
if
(
currently
Process
ing
!=
null
)
{
currently
Process
ing
.
executeCallbacks
();
currently
Process
ing
=
null
;
}
if
(!
segmentsToDrop
.
isEmpty
())
{
...
...
@@ -366,14 +368,14 @@ public class LoadQueuePeon
private
void
entryRemoved
(
String
path
)
{
synchronized
(
lock
)
{
if
(
currently
Load
ing
==
null
)
{
if
(
currently
Process
ing
==
null
)
{
log
.
warn
(
"Server[%s] an entry[%s] was removed even though it wasn't loading!?"
,
basePath
,
path
);
return
;
}
if
(!
ZKPaths
.
getNodeFromPath
(
path
).
equals
(
currently
Load
ing
.
getSegmentIdentifier
()))
{
if
(!
ZKPaths
.
getNodeFromPath
(
path
).
equals
(
currently
Process
ing
.
getSegmentIdentifier
()))
{
log
.
warn
(
"Server[%s] entry [%s] was removed even though it's not what is currently loading[%s]"
,
basePath
,
path
,
currently
Load
ing
basePath
,
path
,
currently
Process
ing
);
return
;
}
...
...
@@ -387,7 +389,7 @@ public class LoadQueuePeon
private
void
failAssign
(
Exception
e
)
{
synchronized
(
lock
)
{
log
.
error
(
e
,
"Server[%s], throwable caught when submitting [%s]."
,
basePath
,
currently
Load
ing
);
log
.
error
(
e
,
"Server[%s], throwable caught when submitting [%s]."
,
basePath
,
currently
Process
ing
);
failedAssignCount
.
getAndIncrement
();
// Act like it was completed so that the coordinator gives it to someone else
actionCompleted
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录