Examples of SlaveConfig


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

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

        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

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

        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

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

        }
    }


    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

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

    }


    @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

Examples of com.taobao.top.analysis.config.SlaveConfig

    SlaveMonitor monitor = new SlaveMonitor();
    slaveConnector.setDownstreamHandler(new ObjectEncoder());
    slaveConnector.setUpstreamHandler(new ObjectDecoder());
     
    StatisticsEngine statisticsEngine = new StatisticsEngine();
    SlaveConfig slaveConfig = new SlaveConfig();
    slaveConfig.load(configfile);
    slaveNode.setConfig(slaveConfig);
    slaveNode.setSlaveConnector(slaveConnector);
    slaveNode.setStatisticsEngine(statisticsEngine);
    slaveNode.setJobResultMerger(jobResultMerger2);
    slaveNode.setMonitor(monitor);
View Full Code Here

Examples of com.taobao.top.analysis.config.SlaveConfig

    SlaveNode slaveNode = new SlaveNode();
    JobResultMerger jobResultMerger2 = new JobResultMerger();
    MemSlaveConnector slaveConnector = new MemSlaveConnector();
    slaveConnector.setTunnel(tunnel);
    StatisticsEngine statisticsEngine = new StatisticsEngine();
    SlaveConfig slaveConfig = new SlaveConfig();
    slaveConfig.load("slave-config.properties");
    slaveNode.setConfig(slaveConfig);
    slaveNode.setSlaveConnector(slaveConnector);
    slaveNode.setStatisticsEngine(statisticsEngine);
    slaveNode.setJobResultMerger(jobResultMerger2);
   
View Full Code Here

Examples of com.taobao.top.analysis.config.SlaveConfig

    /**
     * 初始化slave
     */
    private void buildSlave() {
        node = new SlaveNode();
        nodeConfig = new SlaveConfig();
        slaveConnector = new SocketSlaveConnector();
        monitor = new SlaveMonitor();
        statisticsEngine = new StatisticsEngine();
        httpInputAdaptor = new HttpInputAdaptor();
        hdfsInputAdaptor = new HdfsInputAdaptor();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.