Package com.taobao.metamorphosis.client.consumer

Examples of com.taobao.metamorphosis.client.consumer.FetchManager


        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();
    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.client.consumer.FetchManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.