Package com.taobao.metamorphosis.server.utils

Examples of com.taobao.metamorphosis.server.utils.SlaveConfig


    }


    private BrokerZooKeeper createSlaveBrokerZooKeeper() {
        MetaConfig slaveMetaConfig = new MetaConfig();
        slaveMetaConfig.setSlaveConfig(new SlaveConfig(0));
        this.slaveBrokerZooKeeper = new BrokerZooKeeper(slaveMetaConfig);
        return this.slaveBrokerZooKeeper;
    }
View Full Code Here


        EasyMock.expect(
            this.remotingClient.invokeToGroup(masterUrl,
                new OffsetCommand(topic, GROUP, partition, 0, OpaqueGenerator.getNextOpaque()))).andReturn(resp);
        OpaqueGenerator.resetOpaque();
        final MetaConfig config = new MetaConfig();
        config.setSlaveConfig(new SlaveConfig(0, GROUP, 500, true));
        EasyMock.expect(this.broker.getMetaConfig()).andReturn(config);
        this.mocksControl.replay();
        final TopicPartitionRegInfo info = this.slaveOffsetStorage.load(topic, "ss", new Partition(0, partition));
        this.mocksControl.verify();
View Full Code Here

        EasyMock.expect(
            this.remotingClient.invokeToGroup(masterUrl,
                new OffsetCommand(topic, GROUP, partition, 0, OpaqueGenerator.getNextOpaque()))).andReturn(resp);
        OpaqueGenerator.resetOpaque();
        final MetaConfig config = new MetaConfig();
        config.setSlaveConfig(new SlaveConfig(0, GROUP, 500, true));
        EasyMock.expect(this.broker.getMetaConfig()).andReturn(config);
        this.mocksControl.replay();
        final TopicPartitionRegInfo info = this.slaveOffsetStorage.load(topic, "ss", new Partition(0, partition));
        this.mocksControl.verify();
        Assert.assertEquals(0L, info.getOffset().get());
View Full Code Here

        }
    }


    private void putSlaveProperties(final MetaMorphosisBroker broker, final Properties props) {
        SlaveConfig slaveConfig = new SlaveConfig();
        slaveConfig.setSlaveId(Integer.parseInt(props.getProperty("slaveId")));
        if (StringUtils.isNotBlank(props.getProperty("slaveGroup"))) {
            slaveConfig.setSlaveGroup(props.getProperty("slaveGroup"));
        }
        else {
            // set default slave group
            slaveConfig.setSlaveGroup(slaveConfig.getSlaveGroup() + "_" + slaveConfig.getSlaveId());
        }
        if (StringUtils.isNotBlank(props.getProperty("slaveMaxDelayInMills"))) {
            slaveConfig.setSlaveMaxDelayInMills(Integer.parseInt(props.getProperty("slaveMaxDelayInMills")));
        }
        if (StringUtils.isNotBlank(props.getProperty("autoSyncMasterConfig"))) {
            slaveConfig.setAutoSyncMasterConfig(Boolean.valueOf(props.getProperty("autoSyncMasterConfig")));
        }
        broker.getMetaConfig().setSlaveConfig(slaveConfig);

        // ��������BrokerIdPath���Ա�ע�ᵽslave��·��
        broker.getBrokerZooKeeper().resetBrokerIdPath();
View Full Code Here

    }


    @Test
    public void testStartStop_slave() throws Exception {
        this.metaConfig.setSlaveConfig(new SlaveConfig(0));
        this.broker = new MetaMorphosisBroker(this.metaConfig);
        this.broker.start();
        // start twice,no problem
        this.broker.start();
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.server.utils.SlaveConfig

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.