MessageQueue mq = new MessageQueue();
mq.setTopic(topic);
mq.setBrokerName(this.brokerController.getBrokerConfig().getBrokerName());
mq.setQueueId(i);
TopicOffset topicOffset = new TopicOffset();
long min = this.brokerController.getMessageStore().getMinOffsetInQuque(topic, i);
if (min < 0)
min = 0;
long max = this.brokerController.getMessageStore().getMaxOffsetInQuque(topic, i);
if (max < 0)
max = 0;
long timestamp = 0;
if (max > 0) {
timestamp =
this.brokerController.getMessageStore().getMessageStoreTimeStamp(topic, i, (max - 1));
}
topicOffset.setMinOffset(min);
topicOffset.setMaxOffset(max);
topicOffset.setLastUpdateTimestamp(timestamp);
topicStatsTable.getOffsetTable().put(mq, topicOffset);
}
byte[] body = topicStatsTable.encode();