Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Forever310
druid
提交
9b06b6aa
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,发现更多精彩内容 >>
提交
9b06b6aa
编写于
4月 15, 2014
作者:
F
fjy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
misc fixes for router
上级
291dac8d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
11 deletion
+22
-11
indexing-service/src/main/java/io/druid/indexing/common/task/AbstractTask.java
...main/java/io/druid/indexing/common/task/AbstractTask.java
+2
-2
server/src/main/java/io/druid/server/router/QueryHostFinder.java
...src/main/java/io/druid/server/router/QueryHostFinder.java
+7
-3
server/src/main/java/io/druid/server/router/TieredBrokerHostSelector.java
...java/io/druid/server/router/TieredBrokerHostSelector.java
+9
-2
server/src/test/java/io/druid/server/router/TieredBrokerHostSelectorTest.java
.../io/druid/server/router/TieredBrokerHostSelectorTest.java
+3
-4
services/src/main/java/io/druid/cli/RouterJettyServerInitializer.java
.../main/java/io/druid/cli/RouterJettyServerInitializer.java
+1
-0
未找到文件。
indexing-service/src/main/java/io/druid/indexing/common/task/AbstractTask.java
浏览文件 @
9b06b6aa
...
...
@@ -61,8 +61,8 @@ public abstract class AbstractTask implements Task
protected
AbstractTask
(
String
id
,
String
groupId
,
TaskResource
taskResource
,
String
dataSource
)
{
this
.
id
=
Preconditions
.
checkNotNull
(
id
.
toLowerCase
()
,
"id"
);
this
.
groupId
=
Preconditions
.
checkNotNull
(
groupId
.
toLowerCase
()
,
"groupId"
);
this
.
id
=
Preconditions
.
checkNotNull
(
id
,
"id"
);
this
.
groupId
=
Preconditions
.
checkNotNull
(
groupId
,
"groupId"
);
this
.
taskResource
=
Preconditions
.
checkNotNull
(
taskResource
,
"resource"
);
this
.
dataSource
=
Preconditions
.
checkNotNull
(
dataSource
.
toLowerCase
(),
"dataSource"
);
}
...
...
server/src/main/java/io/druid/server/router/QueryHostFinder.java
浏览文件 @
9b06b6aa
...
...
@@ -50,10 +50,14 @@ public class QueryHostFinder<T>
{
final
Pair
<
String
,
ServerDiscoverySelector
>
selected
=
hostSelector
.
select
(
query
);
final
String
serviceName
=
selected
.
lhs
;
final
ServerDiscoverySelector
selector
=
selected
.
rhs
;
if
(
selected
==
null
)
{
log
.
error
(
"Danger, Will Robinson! Unable to find any brokers!"
);
}
final
String
serviceName
=
selected
==
null
?
hostSelector
.
getDefaultServiceName
()
:
selected
.
lhs
;
final
ServerDiscoverySelector
selector
=
selected
==
null
?
null
:
selected
.
rhs
;
Server
server
=
selector
.
pick
();
Server
server
=
selector
==
null
?
null
:
selector
.
pick
();
if
(
server
==
null
)
{
log
.
error
(
"WTF?! No server found for serviceName[%s]. Using backup"
,
...
...
server/src/main/java/io/druid/server/router/TieredBrokerHostSelector.java
浏览文件 @
9b06b6aa
...
...
@@ -122,7 +122,7 @@ public class TieredBrokerHostSelector<T> implements HostSelector<T>
{
synchronized
(
lock
)
{
if
(!
ruleManager
.
isStarted
()
||
!
started
)
{
return
null
;
return
getDefaultLookup
()
;
}
}
...
...
@@ -157,7 +157,7 @@ public class TieredBrokerHostSelector<T> implements HostSelector<T>
}
if
(
baseRule
==
null
)
{
return
null
;
return
getDefaultLookup
()
;
}
// in the baseRule, find the broker of highest priority
...
...
@@ -192,4 +192,11 @@ public class TieredBrokerHostSelector<T> implements HostSelector<T>
return
new
Pair
<>(
brokerServiceName
,
retVal
);
}
private
Pair
<
String
,
ServerDiscoverySelector
>
getDefaultLookup
()
{
final
String
brokerServiceName
=
tierConfig
.
getDefaultBrokerServiceName
();
final
ServerDiscoverySelector
retVal
=
selectorMap
.
get
(
brokerServiceName
);
return
new
Pair
<>(
brokerServiceName
,
retVal
);
}
}
server/src/test/java/io/druid/server/router/TieredBrokerHostSelectorTest.java
浏览文件 @
9b06b6aa
...
...
@@ -142,19 +142,18 @@ public class TieredBrokerHostSelectorTest
@Test
public
void
testSelectMatchesNothing
()
throws
Exception
{
Pair
retVal
=
brokerSelector
.
select
(
String
brokerName
=
(
String
)
brokerSelector
.
select
(
Druids
.
newTimeseriesQueryBuilder
()
.
dataSource
(
"test"
)
.
granularity
(
"all"
)
.
aggregators
(
Arrays
.<
AggregatorFactory
>
asList
(
new
CountAggregatorFactory
(
"rows"
)))
.
intervals
(
Arrays
.<
Interval
>
asList
(
new
Interval
(
"2010-08-31/2010-09-01"
)))
.
build
()
);
)
.
lhs
;
Assert
.
assertEquals
(
null
,
retVal
);
Assert
.
assertEquals
(
"hotBroker"
,
brokerName
);
}
@Test
public
void
testSelectMultiInterval
()
throws
Exception
{
...
...
services/src/main/java/io/druid/cli/RouterJettyServerInitializer.java
浏览文件 @
9b06b6aa
...
...
@@ -86,6 +86,7 @@ public class RouterJettyServerInitializer implements JettyServerInitializer
),
"/druid/v2/*"
);
queries
.
addFilter
(
GzipFilter
.
class
,
"/druid/v2/*"
,
null
);
queries
.
addFilter
(
GuiceFilter
.
class
,
"/status/*"
,
null
);
final
ServletContextHandler
root
=
new
ServletContextHandler
(
ServletContextHandler
.
SESSIONS
);
root
.
addServlet
(
new
ServletHolder
(
new
DefaultServlet
()),
"/*"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录