Package com.taobao.metamorphosis.server.utils

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


    public static void main(final String[] args) throws IOException, InterruptedException {
        final CommandLine line = StartupHelp.parseCmdLine(args, new PosixParser());
        final Map<String, Properties> pluginsInfo = getPluginsInfo(line);
        tryStartLocalZookeeper(line);
        MetaConfig metaConfig = getMetaConfig(line);
        final EnhancedBroker broker = new EnhancedBroker(metaConfig, pluginsInfo);
        broker.start();
    }
View Full Code Here


        else {
            System.err.println("Please tell me the broker configuration file path by -f option");
            System.exit(1);
        }

        final MetaConfig metaConfig = new MetaConfig();
        metaConfig.loadFromFile(configFilePath);
        metaConfig.verify();
        log.warn("����������Ϊ��" + metaConfig);
        System.out.println("׼������������������Ϊ��" + metaConfig);
        return metaConfig;
    }
View Full Code Here

    }


    @Override
    public void init(final MetaMorphosisBroker metaMorphosisBroker, final Properties props) {
        final MetaConfig metaConfig = metaMorphosisBroker.getMetaConfig();
        // Added slave status topic for master to check it.
        TopicConfig topicConfig = new TopicConfig(Constants.TEST_SLAVE_TOPIC, metaConfig);
        topicConfig.setNumPartitions(1);
        metaConfig.addTopic(Constants.TEST_SLAVE_TOPIC, topicConfig);
        // slave��ע�ᵽzk,ǿ��
        metaMorphosisBroker.getBrokerZooKeeper().getZkConfig().zkEnable = false;
        this.orderedPutExecutor =
                new OrderedThreadPoolExecutor(metaConfig.getPutProcessThreadCount(),
                    metaConfig.getPutProcessThreadCount(), 60, TimeUnit.SECONDS, new NamedThreadFactory("putProcessor"));
        final GregorCommandProcessor processor =
                new GregorCommandProcessor(metaMorphosisBroker.getStoreManager(),
                    metaMorphosisBroker.getExecutorsManager(), metaMorphosisBroker.getStatsManager(),
                    metaMorphosisBroker.getRemotingServer(), metaMorphosisBroker.getMetaConfig(),
                    metaMorphosisBroker.getIdWorker(), metaMorphosisBroker.getBrokerZooKeeper(),
View Full Code Here

    final String topic = "GregorCommandProcessorUnitTest";


    protected void mock() {

        this.metaConfig = new MetaConfig();
        this.mocksControl = EasyMock.createControl();
        this.storeManager = this.mocksControl.createMock(MessageStoreManager.class);
        this.conn = this.mocksControl.createMock(Connection.class);
        this.remotingClient = this.mocksControl.createMock(RemotingClient.class);
        this.sessionContext = new SessionContextImpl(null, this.conn);
        EasyMock.expect(this.conn.getAttribute(SessionContextHolder.GLOBAL_SESSION_KEY)).andReturn(this.sessionContext)
        .anyTimes();
        this.statsManager = new StatsManager(new MetaConfig(), null, null);
        this.idWorker = this.mocksControl.createMock(IdWorker.class);
        this.brokerZooKeeper = this.mocksControl.createMock(BrokerZooKeeper.class);
        this.executorsManager = this.mocksControl.createMock(ExecutorsManager.class);
        this.commandProcessor = new GregorCommandProcessor();
        this.commandProcessor.setMetaConfig(this.metaConfig);
View Full Code Here


    @Test
    public void testRecover() throws Exception {
        this.mockSlaveServer();
        final MetaConfig metaConfig = new MetaConfig();
        metaConfig.setDataPath(this.getDataPath());
        final String topic = "SamsaMasterBrokerUnitTest";
        metaConfig.getTopics().add(topic);
        metaConfig.setNumPartitions(5);
        metaConfig.setMaxSegmentSize(1024 * 1024);
        final MetaMorphosisBroker metaBroker = new MetaMorphosisBroker(metaConfig);

        final IdWorker idWorker = metaBroker.getIdWorker();
        final byte[] data = new byte[1024];
        // ��Ҫ��recover��offset��Ϣ
View Full Code Here

        OpaqueGenerator.resetOpaque();
        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

        OpaqueGenerator.resetOpaque();
        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 final int brokerId = 999;


    @Before
    public void setup() throws Exception {
        this.metaConfig = new MetaConfig();
        this.metaConfig.setBrokerId(this.brokerId);
        this.metaConfig.setHostName("localhost");
        this.metaConfig.setServerPort(8199);
        ZKConfig zkConfig = new ZKConfig();
        this.metaConfig.setZkConfig(zkConfig);
View Full Code Here

    private final String slaveUrl = "meta://localhost:8124";


    protected void mock() {

        this.metaConfig = new MetaConfig();
        this.mocksControl = EasyMock.createControl();
        this.storeManager = this.mocksControl.createMock(MessageStoreManager.class);
        this.conn = this.mocksControl.createMock(Connection.class);
        this.remotingClient = this.mocksControl.createMock(RemotingClient.class);
        this.sessionContext = new SessionContextImpl(null, this.conn);
        EasyMock.expect(this.conn.getAttribute(SessionContextHolder.GLOBAL_SESSION_KEY)).andReturn(this.sessionContext)
        .anyTimes();
        this.statsManager = new StatsManager(new MetaConfig(), null, null);
        this.idWorker = this.mocksControl.createMock(IdWorker.class);
        this.brokerZooKeeper = this.mocksControl.createMock(BrokerZooKeeper.class);
        this.executorsManager = this.mocksControl.createMock(ExecutorsManager.class);
        this.commandProcessor = new SamsaCommandProcessor();
        this.commandProcessor.setMetaConfig(this.metaConfig);
View Full Code Here

    }


    protected EnhancedBroker startEnhanceBroker(final String name, final boolean isClearConsumerInfo,
            final boolean isClearMsg, final Map<String, Properties> pluginsInfo) throws Exception {
        final MetaConfig metaConfig = this.metaConfig(name);
        metaConfig.setDashboardHttpPort(metaConfig.getServerPort() - 80);
        if (isClearMsg) {
            Utils.clearDataDir(metaConfig);
        }
        final EnhancedBroker broker = new EnhancedBroker(metaConfig, pluginsInfo);
        if (isClearConsumerInfo) {
View Full Code Here

TOP

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

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.