Package com.taobao.metamorphosis.metaslave.SlaveConsumerZooKeeper

Examples of com.taobao.metamorphosis.metaslave.SlaveConsumerZooKeeper.SlaveZKLoadRebalanceListener


        this.slaveConsumerZooKeeper.registerConsumer(consumerConfig, this.fetchManager, topicSubcriberRegistry,
            this.offsetStorage, this.loadBalanceStrategy);
        this.mocksControl.verify();

        // ��֤�����߷���,ֻ�����Լ�master�µ����з�����
        final SlaveZKLoadRebalanceListener listener = this.checkTopic();

        final Set<Broker> brokerSet = ConsumerZooKeeperAccessor.getOldBrokerSet(listener);
        assertEquals(1, brokerSet.size());
        assertTrue(brokerSet.contains(new Broker(0, "meta://localhost:0")));
        assertFalse(brokerSet.contains(new Broker(1, "meta://localhost:1")));
View Full Code Here


        assertFalse(brokerSet.contains(new Broker(1, "meta://localhost:1")));
    }


    private SlaveZKLoadRebalanceListener checkTopic() {
        final SlaveZKLoadRebalanceListener listener =
                (SlaveZKLoadRebalanceListener) ConsumerZooKeeperAccessor.getBrokerConnectionListenerForTest(
                    this.slaveConsumerZooKeeper, this.fetchManager);
        assertNotNull(listener);

        final ConcurrentHashMap<String/* topic */, ConcurrentHashMap<Partition, TopicPartitionRegInfo>> topicRegistry =
View Full Code Here

        ZkUtils.deletePath(this.client, this.metaZookeeper.brokerTopicsSubPath + "/topic2/0-m");
        Thread.sleep(5000);
        this.mocksControl.verify();

        // master �ҵ����˹�ͣ��,TopicPartitionRegInfo�����
        final SlaveZKLoadRebalanceListener listener =
                (SlaveZKLoadRebalanceListener) ConsumerZooKeeperAccessor.getBrokerConnectionListenerForTest(
                    this.slaveConsumerZooKeeper, this.fetchManager);
        assertNotNull(listener);

        final ConcurrentHashMap<String/* topic */, ConcurrentHashMap<Partition, TopicPartitionRegInfo>> topicRegistry =
View Full Code Here

            new TopicBroker(1, "0-m").toJson());
        Thread.sleep(5000);
        this.mocksControl.verify();

        // �ָ���testReigsterSlaveConsumerʱ��״̬
        final SlaveZKLoadRebalanceListener listener = this.checkTopic();
        final Set<Broker> brokerSet = ConsumerZooKeeperAccessor.getOldBrokerSet(listener);
        assertEquals(1, brokerSet.size());
        assertTrue(brokerSet.contains(new Broker(0, "meta://localhost:0")));
        assertFalse(brokerSet.contains(new Broker(1, "meta://localhost:1")));
View Full Code Here

        // other master down,no problem
        ZkUtils.deletePath(this.client, this.metaZookeeper.brokerIdsPath + "/1/master");
        ZkUtils.deletePath(this.client, this.metaZookeeper.brokerTopicsSubPath + "/topic2/1-m");
        Thread.sleep(5000);
        this.mocksControl.verify();
        final SlaveZKLoadRebalanceListener listener = this.checkTopic();

        final Set<Broker> brokerSet = ConsumerZooKeeperAccessor.getOldBrokerSet(listener);
        assertEquals(1, brokerSet.size());
        assertTrue(brokerSet.contains(new Broker(0, "meta://localhost:0")));
        assertFalse(brokerSet.contains(new Broker(1, "meta://localhost:1")));
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.metaslave.SlaveConsumerZooKeeper.SlaveZKLoadRebalanceListener

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.