this.appendKeyValue(sb, "Subscriber handler", this.isStarted.get() ? "running" : "stop");
if (!this.isStarted() || this.consumer == null) {
return sb.toString();
}
SlaveConsumerZooKeeper scz = (SlaveConsumerZooKeeper) this.sessionFactory.getConsumerZooKeeper();
FetchManager fetchManager = ((SimpleMessageConsumer) this.consumer).getFetchManager();
ZKLoadRebalanceListener listener = scz.getBrokerConnectionListener(fetchManager);
Map<String, Set<Partition>> topicPartitions = listener.getTopicPartitions();
int totalPartitions = 0;
for (Set<Partition> set : topicPartitions.values()) {
totalPartitions += set.size();
}
this.appendKeyValue(sb, "Replicate partitions", totalPartitions);
this.appendKeyValue(sb, "Replicate topic partitions detail", "");
for (Map.Entry<String, Set<Partition>> entry : topicPartitions.entrySet()) {
this.appendKeyValue(sb, " " + entry.getKey(), entry.getValue().size());
}
int fetchRequestCount = fetchManager.getFetchRequestCount();
this.appendKeyValue(sb, "Replicate requests", fetchRequestCount);
this.appendKeyValue(sb, "Replicate runner", fetchManager.isShutdown() ? "stop" : "running");
this.appendKeyValue(sb, "Replicate status",
fetchRequestCount == totalPartitions && !fetchManager.isShutdown() ? "yes" : "no");
return sb.toString();
}