RemotingCommand request =
RemotingCommand.createRequestCommand(MQRequestCode.GET_TOPIC_STATS_INFO_VALUE, requestHeader);
RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
switch (response.getCode()) {
case ResponseCode.SUCCESS_VALUE: {
TopicStatsTable topicStatsTable =
TopicStatsTable.decode(response.getBody(), TopicStatsTable.class);
// 清除虚拟运行环境相关的projectGroupPrefix
if (!UtilAll.isBlank(projectGroupPrefix)) {
HashMap<MessageQueue, TopicOffset> newTopicOffsetMap =
new HashMap<MessageQueue, TopicOffset>();
for (Map.Entry<MessageQueue, TopicOffset> messageQueue : topicStatsTable.getOffsetTable()
.entrySet()) {
MessageQueue key = messageQueue.getKey();
key.setTopic(VirtualEnvUtil.clearProjectGroup(key.getTopic(), projectGroupPrefix));
newTopicOffsetMap.put(key, messageQueue.getValue());
}
topicStatsTable.setOffsetTable(newTopicOffsetMap);
}
return topicStatsTable;
}
default:
break;