Package com.taobao.metamorphosis.server.exception

Examples of com.taobao.metamorphosis.server.exception.MetamorphosisServerStartupException


            StringReader reader = new StringReader(str);
            final Ini conf = new Ini(reader);
            this.populateAttributes(conf);
        }
        catch (final IOException e) {
            throw new MetamorphosisServerStartupException("Parse configuration failed,path=" + this.path, e);
        }
    }
View Full Code Here


    /**
     * У�������Ƿ���ȷ
     */
    public void verify() {
        if (this.getTopics().isEmpty()) {
            throw new MetamorphosisServerStartupException("Empty topics list");
        }
        ZKConfig zkconfig = this.zkConfig;
        if (zkconfig == null) {
            throw new IllegalStateException("Null zookeeper config");
        }
View Full Code Here

        JournalTransactionStore transactionStore = null;
        try {
            transactionStore = new JournalTransactionStore(metaConfig.getDataLogPath(), this.storeManager, metaConfig);
        }
        catch (final Exception e) {
            throw new MetamorphosisServerStartupException("Initializing transaction store failed", e);
        }
        try {
            this.consumerFilterManager = new ConsumerFilterManager(metaConfig);
        }
        catch (final Exception e) {
            throw new MetamorphosisServerStartupException("Initializing ConsumerFilterManager failed", e);
        }
        final BrokerCommandProcessor next =
                new BrokerCommandProcessor(this.storeManager, this.executorsManager, this.statsManager,
                    this.remotingServer, metaConfig, this.idWorker, this.brokerZooKeeper, this.consumerFilterManager);
        this.brokerProcessor =
View Full Code Here

        this.registerProcessors();
        try {
            this.remotingServer.start();
        }
        catch (final NotifyRemotingException e) {
            throw new MetamorphosisServerStartupException("start remoting server failed", e);
        }
        try {
            this.brokerZooKeeper.registerBrokerInZk();
            this.brokerZooKeeper.registerMasterConfigFileChecksumInZk();
            this.addTopicsChangeListener();
            this.registerTopicsInZk();
            this.registerZkSuccess = true;
        }
        catch (final Exception e) {
            this.registerZkSuccess = false;
            throw new MetamorphosisServerStartupException("Register broker to zk failed", e);
        }
        log.info("Starting metamorphosis server...");
        this.brokerProcessor.init();
        log.info("Start metamorphosis server successfully");
    }
View Full Code Here

        CommandLine line = null;
        try {
            line = parser.parse(options, args);
        }
        catch (final ParseException e) {
            throw new MetamorphosisServerStartupException("Parse command line failed", e);
        }
        String configFilePath = null;
        if (line.hasOption("f")) {
            configFilePath = line.getOptionValue("f");
        }
        else {
            System.err.println("Please tell me the configuration file path by -f option");
            System.exit(1);
        }
        if (StringUtils.isBlank(configFilePath)) {
            throw new MetamorphosisServerStartupException("Blank file path");
        }
        return configFilePath;
    }
View Full Code Here

            try {
                this.recoverPartitions(storeManager, zkClient, consumersPath, brokerId, consumers, allRecoverParts);
                log.info("Recover offset successfully in " + (System.currentTimeMillis() - start) / 1000 + " seconds");
            }
            catch (final IOException e) {
                throw new MetamorphosisServerStartupException("Recover offset on startup failed", e);
            }
        }

        // ��recover֮�󣬴�zkע��
        this.registerToZk();
View Full Code Here

        this.broker.getBrokerZooKeeper().getZkConfig().zkEnable = true;
        try {
            this.broker.getBrokerZooKeeper().reRegisterEveryThing();
        }
        catch (final Exception e) {
            throw new MetamorphosisServerStartupException("Register broker to zookeeper failed", e);
        }
    }
View Full Code Here

    @Override
    public void init(final MetaMorphosisBroker metaMorphosisBroker, final Properties props) {
        this.broker = metaMorphosisBroker;
        this.props = props;
        if (this.props == null) {
            throw new MetamorphosisServerStartupException("Null samsa_master properties");
        }
        this.recoverOffset = Boolean.valueOf(this.props.getProperty("recoverOffset", "false"));
        // ��Ҫrecover offset����ʱ�Ȳ�������zookeeper�ϣ���recover֮���ע����ȥ
        if (this.recoverOffset) {
            this.broker.getBrokerZooKeeper().getZkConfig().zkEnable = false;
        }
        final int callbackThreadCount =
                Integer.parseInt(props.getProperty("callbackThreadCount", String.valueOf(DEFAULT_CB_THREADPOOL_SIZE)));
        final String slave = props.getProperty("slave");
        if (StringUtils.isBlank(slave)) {
            throw new IllegalArgumentException("Blank slave");
        }
        this.setConfigs(props);
        final ClientConfig clientConfig = new ClientConfig();
        // ֻʹ��1��reactor
        clientConfig.setSelectorPoolSize(1);
        clientConfig.setWireFormatType(new MetamorphosisWireFormatType());
        try {
            this.remotingClient = RemotingFactory.newRemotingClient(clientConfig);
            this.remotingClient.start();
            this.masterProcessor =
                    new SamsaCommandProcessor(metaMorphosisBroker.getStoreManager(),
                        metaMorphosisBroker.getExecutorsManager(), metaMorphosisBroker.getStatsManager(),
                        metaMorphosisBroker.getRemotingServer(), metaMorphosisBroker.getMetaConfig(),
                        metaMorphosisBroker.getIdWorker(), metaMorphosisBroker.getBrokerZooKeeper(),
                        this.remotingClient, metaMorphosisBroker.getConsumerFilterManager(), slave,
                        callbackThreadCount, this.sendToSlaveTimeoutInMills, this.checkSlaveIntervalInMills,
                        this.slaveContinuousFailureThreshold);
            // �滻������
            this.broker.setBrokerProcessor(this.masterProcessor);
            log.info("Init samsa mater successfully with config:" + props);
        }
        catch (final NotifyRemotingException e) {
            throw new MetamorphosisServerStartupException("Init master processor failed", e);
        }
        catch (final InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.server.exception.MetamorphosisServerStartupException

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.