Package org.I0Itec.zkclient

Examples of org.I0Itec.zkclient.ZkClient


        // start twice,no problem
        this.broker.start();

        // ����ȷ��zk������ȷ
        final BrokerZooKeeper brokerZooKeeper = this.broker.getBrokerZooKeeper();
        final ZkClient client = brokerZooKeeper.getZkClient();
        assertTrue(ZkUtils.pathExists(client, "/meta/brokers/ids/" + this.metaConfig.getBrokerId() + "/master"));
        assertEquals("meta://localhost:8199",
            ZkUtils.readData(client, "/meta/brokers/ids/" + this.metaConfig.getBrokerId() + "/master"));
        assertTrue(ZkUtils.pathExists(client, "/meta/brokers/topics/topic1/" + this.metaConfig.getBrokerId() + "-m"));
        assertTrue(ZkUtils.pathExists(client, "/meta/brokers/topics/topic2/" + this.metaConfig.getBrokerId() + "-m"));
View Full Code Here


        // start twice,no problem
        this.broker.start();

        // ����ȷ��zk������ȷ
        final BrokerZooKeeper brokerZooKeeper = this.broker.getBrokerZooKeeper();
        final ZkClient client = brokerZooKeeper.getZkClient();
        assertTrue(ZkUtils.pathExists(client, "/meta/brokers/ids/" + this.metaConfig.getBrokerId() + "/slave0"));
        assertTrue(ZkUtils.pathExists(client, "/meta/brokers/topics/topic1/" + this.metaConfig.getBrokerId() + "-s0"));
        assertTrue(ZkUtils.pathExists(client, "/meta/brokers/topics/topic2/" + this.metaConfig.getBrokerId() + "-s0"));
        final String serverUrl =
                ZkUtils.readData(client, "/meta/brokers/ids/" + this.metaConfig.getBrokerId() + "/slave0");
View Full Code Here

            return;
        }

        final MetaZookeeper metaZookeeper = this.broker.getBrokerZooKeeper().getMetaZookeeper();
        final MessageStoreManager storeManager = this.broker.getStoreManager();
        final ZkClient zkClient = metaZookeeper.getZkClient();
        final String consumersPath = metaZookeeper.consumersPath;
        final Set<String> topics = this.broker.getBrokerZooKeeper().getTopics();
        final int brokerId = this.broker.getMetaConfig().getBrokerId();
        final List<String> consumers = ZkUtils.getChildrenMaybeNull(zkClient, consumersPath);
        // û�ж����ߣ�����recover
View Full Code Here

            this.zkConfig = this.loadZkConfigFromLocalFile();

        }
        if (this.zkConfig != null) {
            this.zkClient =
                    new ZkClient(this.zkConfig.zkConnect, this.zkConfig.zkSessionTimeoutMs,
                        this.zkConfig.zkConnectionTimeoutMs, new ZkUtils.StringSerializer());
            this.metaZookeeper = new MetaZookeeper(this.zkClient, this.zkConfig.zkRoot);
        }
        else {
            throw new MetaClientException("No zk config offered");
View Full Code Here

TOP

Related Classes of org.I0Itec.zkclient.ZkClient

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.