Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Apache RocketMQ
Rocketmq
提交
e6768baa
R
Rocketmq
项目概览
Apache RocketMQ
/
Rocketmq
上一次同步 接近 3 年
通知
259
Star
16137
Fork
69
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6768baa
编写于
6月 23, 2021
作者:
H
HeChengyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ISSUE #2962] Implement DefaultMQAdminExt::examineTopicConfig function
上级
df1d93fc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
4 deletion
+21
-4
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
...va/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
+1
-1
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
...rg/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
+3
-2
tools/src/main/java/org/apache/rocketmq/tools/admin/MQAdminExt.java
...main/java/org/apache/rocketmq/tools/admin/MQAdminExt.java
+1
-1
tools/src/test/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtTest.java
...rg/apache/rocketmq/tools/admin/DefaultMQAdminExtTest.java
+16
-0
未找到文件。
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java
浏览文件 @
e6768baa
...
@@ -208,7 +208,7 @@ public class DefaultMQAdminExt extends ClientConfig implements MQAdminExt {
...
@@ -208,7 +208,7 @@ public class DefaultMQAdminExt extends ClientConfig implements MQAdminExt {
}
}
@Override
@Override
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
{
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
throws
RemotingException
,
InterruptedException
,
MQBrokerException
{
return
defaultMQAdminExtImpl
.
examineTopicConfig
(
addr
,
topic
);
return
defaultMQAdminExtImpl
.
examineTopicConfig
(
addr
,
topic
);
}
}
...
...
tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
浏览文件 @
e6768baa
...
@@ -222,8 +222,9 @@ public class DefaultMQAdminExtImpl implements MQAdminExt, MQAdminExtInner {
...
@@ -222,8 +222,9 @@ public class DefaultMQAdminExtImpl implements MQAdminExt, MQAdminExtInner {
}
}
@Override
@Override
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
{
public
TopicConfig
examineTopicConfig
(
String
addr
,
String
topic
)
throws
RemotingException
,
InterruptedException
,
MQBrokerException
{
return
null
;
TopicConfigSerializeWrapper
topicConfigSerializeWrapper
=
this
.
mqClientInstance
.
getMQClientAPIImpl
().
getAllTopicConfig
(
addr
,
timeoutMillis
);
return
topicConfigSerializeWrapper
.
getTopicConfigTable
().
get
(
topic
);
}
}
@Override
@Override
...
...
tools/src/main/java/org/apache/rocketmq/tools/admin/MQAdminExt.java
浏览文件 @
e6768baa
...
@@ -92,7 +92,7 @@ public interface MQAdminExt extends MQAdmin {
...
@@ -92,7 +92,7 @@ public interface MQAdminExt extends MQAdmin {
SubscriptionGroupConfig
examineSubscriptionGroupConfig
(
final
String
addr
,
final
String
group
);
SubscriptionGroupConfig
examineSubscriptionGroupConfig
(
final
String
addr
,
final
String
group
);
TopicConfig
examineTopicConfig
(
final
String
addr
,
final
String
topic
);
TopicConfig
examineTopicConfig
(
final
String
addr
,
final
String
topic
)
throws
RemotingException
,
InterruptedException
,
MQBrokerException
;
TopicStatsTable
examineTopicStats
(
TopicStatsTable
examineTopicStats
(
final
String
topic
)
throws
RemotingException
,
MQClientException
,
InterruptedException
,
final
String
topic
)
throws
RemotingException
,
MQClientException
,
InterruptedException
,
...
...
tools/src/test/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtTest.java
浏览文件 @
e6768baa
...
@@ -34,6 +34,7 @@ import org.apache.rocketmq.client.exception.MQClientException;
...
@@ -34,6 +34,7 @@ import org.apache.rocketmq.client.exception.MQClientException;
import
org.apache.rocketmq.client.impl.MQClientAPIImpl
;
import
org.apache.rocketmq.client.impl.MQClientAPIImpl
;
import
org.apache.rocketmq.client.impl.MQClientManager
;
import
org.apache.rocketmq.client.impl.MQClientManager
;
import
org.apache.rocketmq.client.impl.factory.MQClientInstance
;
import
org.apache.rocketmq.client.impl.factory.MQClientInstance
;
import
org.apache.rocketmq.common.TopicConfig
;
import
org.apache.rocketmq.common.admin.ConsumeStats
;
import
org.apache.rocketmq.common.admin.ConsumeStats
;
import
org.apache.rocketmq.common.admin.OffsetWrapper
;
import
org.apache.rocketmq.common.admin.OffsetWrapper
;
import
org.apache.rocketmq.common.admin.TopicOffset
;
import
org.apache.rocketmq.common.admin.TopicOffset
;
...
@@ -54,6 +55,7 @@ import org.apache.rocketmq.common.protocol.body.ProcessQueueInfo;
...
@@ -54,6 +55,7 @@ import org.apache.rocketmq.common.protocol.body.ProcessQueueInfo;
import
org.apache.rocketmq.common.protocol.body.ProducerConnection
;
import
org.apache.rocketmq.common.protocol.body.ProducerConnection
;
import
org.apache.rocketmq.common.protocol.body.QueueTimeSpan
;
import
org.apache.rocketmq.common.protocol.body.QueueTimeSpan
;
import
org.apache.rocketmq.common.protocol.body.SubscriptionGroupWrapper
;
import
org.apache.rocketmq.common.protocol.body.SubscriptionGroupWrapper
;
import
org.apache.rocketmq.common.protocol.body.TopicConfigSerializeWrapper
;
import
org.apache.rocketmq.common.protocol.body.TopicList
;
import
org.apache.rocketmq.common.protocol.body.TopicList
;
import
org.apache.rocketmq.common.protocol.heartbeat.ConsumeType
;
import
org.apache.rocketmq.common.protocol.heartbeat.ConsumeType
;
import
org.apache.rocketmq.common.protocol.heartbeat.MessageModel
;
import
org.apache.rocketmq.common.protocol.heartbeat.MessageModel
;
...
@@ -225,6 +227,14 @@ public class DefaultMQAdminExtTest {
...
@@ -225,6 +227,14 @@ public class DefaultMQAdminExtTest {
consumerRunningInfo
.
setStatusTable
(
new
TreeMap
<
String
,
ConsumeStatus
>());
consumerRunningInfo
.
setStatusTable
(
new
TreeMap
<
String
,
ConsumeStatus
>());
consumerRunningInfo
.
setSubscriptionSet
(
new
TreeSet
<
SubscriptionData
>());
consumerRunningInfo
.
setSubscriptionSet
(
new
TreeSet
<
SubscriptionData
>());
when
(
mQClientAPIImpl
.
getConsumerRunningInfo
(
anyString
(),
anyString
(),
anyString
(),
anyBoolean
(),
anyLong
())).
thenReturn
(
consumerRunningInfo
);
when
(
mQClientAPIImpl
.
getConsumerRunningInfo
(
anyString
(),
anyString
(),
anyString
(),
anyBoolean
(),
anyLong
())).
thenReturn
(
consumerRunningInfo
);
TopicConfigSerializeWrapper
topicConfigSerializeWrapper
=
new
TopicConfigSerializeWrapper
();
topicConfigSerializeWrapper
.
setTopicConfigTable
(
new
ConcurrentHashMap
<
String
,
TopicConfig
>()
{
{
put
(
"topic_test_examine_topicConfig"
,
new
TopicConfig
(
"topic_test_examine_topicConfig"
));
}
});
when
(
mQClientAPIImpl
.
getAllTopicConfig
(
anyString
(),
anyLong
())).
thenReturn
(
topicConfigSerializeWrapper
);
}
}
@AfterClass
@AfterClass
...
@@ -406,4 +416,10 @@ public class DefaultMQAdminExtTest {
...
@@ -406,4 +416,10 @@ public class DefaultMQAdminExtTest {
assertThat
(
subscriptionGroupWrapper
.
getSubscriptionGroupTable
().
get
(
"Consumer-group-one"
).
getGroupName
()).
isEqualTo
(
"Consumer-group-one"
);
assertThat
(
subscriptionGroupWrapper
.
getSubscriptionGroupTable
().
get
(
"Consumer-group-one"
).
getGroupName
()).
isEqualTo
(
"Consumer-group-one"
);
assertThat
(
subscriptionGroupWrapper
.
getSubscriptionGroupTable
().
get
(
"Consumer-group-one"
).
isConsumeBroadcastEnable
()).
isTrue
();
assertThat
(
subscriptionGroupWrapper
.
getSubscriptionGroupTable
().
get
(
"Consumer-group-one"
).
isConsumeBroadcastEnable
()).
isTrue
();
}
}
@Test
public
void
testExamineTopicConfig
()
throws
MQBrokerException
,
RemotingException
,
InterruptedException
{
TopicConfig
topicConfig
=
defaultMQAdminExt
.
examineTopicConfig
(
"127.0.0.1:10911"
,
"topic_test_examine_topicConfig"
);
assertThat
(
topicConfig
.
getTopicName
().
equals
(
"topic_test_examine_topicConfig"
));
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录