Package com.taobao.metamorphosis.client.consumer.ConsumerZooKeeper

Examples of com.taobao.metamorphosis.client.consumer.ConsumerZooKeeper.ZKLoadRebalanceListener


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


        try {
            final long currentOffset = fetchRequest.getOffset();
            final String serverUrl = fetchRequest.getBroker().getZKString();
            if (!this.remotingClient.isConnected(serverUrl)) {
                // Try to heal the connection.
                ZKLoadRebalanceListener listener =
                        this.consumerZooKeeper.getBrokerConnectionListener(this.fetchManager);
                if (listener.oldBrokerSet.contains(fetchRequest.getBroker())) {
                    this.remotingClient.connectWithRef(serverUrl, listener);
                }
                return null;
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.client.consumer.ConsumerZooKeeper.ZKLoadRebalanceListener

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.