Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
pulsar
提交
99f7e21f
pulsar
项目概览
apache
/
pulsar
通知
129
Star
40
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
pulsar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
99f7e21f
编写于
1月 31, 2017
作者:
R
Rajan
提交者:
Matteo Merli
1月 31, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Configure split-bundle task interval different than loadReportGenerationTask-interval (#183)
上级
de2a6110
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
2 addition
and
71 deletion
+2
-71
conf/broker.conf
conf/broker.conf
+0
-3
conf/standalone.conf
conf/standalone.conf
+0
-3
pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfiguration.java
...in/java/com/yahoo/pulsar/broker/ServiceConfiguration.java
+0
-10
pulsar-broker/src/main/java/com/yahoo/pulsar/broker/PulsarService.java
.../src/main/java/com/yahoo/pulsar/broker/PulsarService.java
+0
-9
pulsar-broker/src/main/java/com/yahoo/pulsar/broker/loadbalance/NamespaceBundleSplitTask.java
...o/pulsar/broker/loadbalance/NamespaceBundleSplitTask.java
+0
-42
pulsar-broker/src/main/java/com/yahoo/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
...pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
+2
-0
pulsar-broker/src/test/java/com/yahoo/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
.../pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
+0
-4
未找到文件。
conf/broker.conf
浏览文件 @
99f7e21f
...
...
@@ -237,9 +237,6 @@ loadBalancerBrokerComfortLoadLevelPercentage=65
# enable/disable namespace bundle auto split
loadBalancerAutoBundleSplitEnabled
=
false
# interval to detect & split hot namespace bundle
loadBalancerNamespaceBundleSplitIntervalMinutes
=
15
# maximum topics in a bundle, otherwise bundle split will be triggered
loadBalancerNamespaceBundleMaxTopics
=
1000
...
...
conf/standalone.conf
浏览文件 @
99f7e21f
...
...
@@ -210,9 +210,6 @@ loadBalancerBrokerComfortLoadLevelPercentage=65
# enable/disable namespace bundle auto split
loadBalancerAutoBundleSplitEnabled
=
false
# interval to detect & split hot namespace bundle
loadBalancerNamespaceBundleSplitIntervalMinutes
=
15
# maximum topics in a bundle, otherwise bundle split will be triggered
loadBalancerNamespaceBundleMaxTopics
=
1000
...
...
pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfiguration.java
浏览文件 @
99f7e21f
...
...
@@ -207,8 +207,6 @@ public class ServiceConfiguration implements PulsarConfiguration{
private
int
loadBalancerBrokerComfortLoadLevelPercentage
=
65
;
// enable/disable automatic namespace bundle split
private
boolean
loadBalancerAutoBundleSplitEnabled
=
false
;
// interval to detect & split hot namespace bundle
private
int
loadBalancerNamespaceBundleSplitIntervalMinutes
=
15
;
// maximum topics in a bundle, otherwise bundle split will be triggered
private
int
loadBalancerNamespaceBundleMaxTopics
=
1000
;
// maximum sessions (producers + consumers) in a bundle, otherwise bundle split will be triggered
...
...
@@ -759,14 +757,6 @@ public class ServiceConfiguration implements PulsarConfiguration{
return
loadBalancerBrokerOverloadedThresholdPercentage
;
}
public
void
setLoadBalancerBundleSplitIntervalMinutes
(
int
interval
)
{
this
.
loadBalancerNamespaceBundleSplitIntervalMinutes
=
interval
;
}
public
int
getLoadBalancerBundleSplitIntervalMinutes
()
{
return
this
.
loadBalancerNamespaceBundleSplitIntervalMinutes
;
}
public
void
setLoadBalancerNamespaceBundleMaxTopics
(
int
topics
)
{
this
.
loadBalancerNamespaceBundleMaxTopics
=
topics
;
}
...
...
pulsar-broker/src/main/java/com/yahoo/pulsar/broker/PulsarService.java
浏览文件 @
99f7e21f
...
...
@@ -45,7 +45,6 @@ import com.yahoo.pulsar.broker.loadbalance.LoadManager;
import
com.yahoo.pulsar.broker.loadbalance.LoadReportUpdaterTask
;
import
com.yahoo.pulsar.broker.loadbalance.LoadResourceQuotaUpdaterTask
;
import
com.yahoo.pulsar.broker.loadbalance.LoadSheddingTask
;
import
com.yahoo.pulsar.broker.loadbalance.NamespaceBundleSplitTask
;
import
com.yahoo.pulsar.broker.loadbalance.impl.SimpleLoadManagerImpl
;
import
com.yahoo.pulsar.broker.namespace.NamespaceService
;
import
com.yahoo.pulsar.broker.service.BrokerService
;
...
...
@@ -92,7 +91,6 @@ public class PulsarService implements AutoCloseable {
private
final
OrderedSafeExecutor
orderedExecutor
=
new
OrderedSafeExecutor
(
8
,
"pulsar-ordered"
);
private
ScheduledExecutorService
loadManagerExecutor
=
null
;
private
ScheduledFuture
<?>
loadReportTask
=
null
;
private
ScheduledFuture
<?>
bundleSplitTask
=
null
;
private
ScheduledFuture
<?>
loadSheddingTask
=
null
;
private
ScheduledFuture
<?>
loadResourceQuotaTask
=
null
;
private
LoadManager
loadManager
=
null
;
...
...
@@ -408,13 +406,6 @@ public class PulsarService implements AutoCloseable {
new
LoadReportUpdaterTask
(
loadManager
),
loadReportMinInterval
,
loadReportMinInterval
,
TimeUnit
.
MILLISECONDS
);
}
if
(
this
.
bundleSplitTask
==
null
)
{
long
bundleSplitInterval
=
TimeUnit
.
MINUTES
.
toMillis
(
getConfiguration
().
getLoadBalancerBundleSplitIntervalMinutes
());
this
.
bundleSplitTask
=
this
.
loadManagerExecutor
.
scheduleAtFixedRate
(
new
NamespaceBundleSplitTask
(
loadManager
),
bundleSplitInterval
,
bundleSplitInterval
,
TimeUnit
.
MILLISECONDS
);
}
}
}
...
...
pulsar-broker/src/main/java/com/yahoo/pulsar/broker/loadbalance/NamespaceBundleSplitTask.java
已删除
100644 → 0
浏览文件 @
de2a6110
/**
* Copyright 2016 Yahoo Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com.yahoo.pulsar.broker.loadbalance
;
import
java.lang.Runnable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Represents a task which detect hot namespace bundle to split
*/
public
class
NamespaceBundleSplitTask
implements
Runnable
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
NamespaceBundleSplitTask
.
class
);
private
final
LoadManager
loadManager
;
public
NamespaceBundleSplitTask
(
LoadManager
manager
)
{
loadManager
=
manager
;
}
@Override
public
void
run
()
{
try
{
loadManager
.
doNamespaceBundleSplit
();
}
catch
(
Exception
e
)
{
LOG
.
warn
(
"Error while doing namespace bundle split."
,
e
);
}
}
}
pulsar-broker/src/main/java/com/yahoo/pulsar/broker/loadbalance/impl/SimpleLoadManagerImpl.java
浏览文件 @
99f7e21f
...
...
@@ -1199,6 +1199,8 @@ public class SimpleLoadManagerImpl implements LoadManager, ZooKeeperCacheListene
-
1
);
this
.
lastLoadReport
=
lr
;
this
.
lastResourceUsageTimestamp
=
lr
.
getTimestamp
();
// split-bundle if requires
doNamespaceBundleSplit
();
}
}
...
...
pulsar-broker/src/test/java/com/yahoo/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
浏览文件 @
99f7e21f
...
...
@@ -459,10 +459,6 @@ public class SimpleLoadManagerImplTest {
LoadSheddingTask
task2
=
new
LoadSheddingTask
(
loadManager
);
task2
.
run
();
verify
(
loadManager
,
times
(
1
)).
doLoadShedding
();
NamespaceBundleSplitTask
task3
=
new
NamespaceBundleSplitTask
(
loadManager
);
task3
.
run
();
verify
(
loadManager
,
times
(
1
)).
doNamespaceBundleSplit
();
}
@Test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录