Package org.apache.hedwig.server.common

Examples of org.apache.hedwig.server.common.ServerConfiguration


    @Override
    protected void setUp() throws Exception {
        super.setUp();

        ServerConfiguration conf = new ServerConfiguration();
        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();

        TopicManager tm = new TrivialOwnAllTopicManager(conf, executor);
        dm = new StubDeliveryManager();
        PersistenceManager pm = LocalDBPersistenceManager.instance();
View Full Code Here


    Callback<MessageSeqId> msgIdCallback;

    @Override
    public void setUp() throws Exception {
        super.setUp();
        cfg = new ServerConfiguration();
        final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
        sm = new ZkSubscriptionManager(zk, new TrivialOwnAllTopicManager(cfg, scheduler), null, cfg, scheduler);
        msgIdCallback = new Callback<MessageSeqId>() {
            @Override
            public void operationFailed(Object ctx, final PubSubException exception) {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        bktb = new BookKeeperTestBase(numBookies);
        bktb.setUp();

        conf = new ServerConfiguration();
        scheduler = Executors.newScheduledThreadPool(1);
        tm = new TrivialOwnAllTopicManager(conf, scheduler);

        bkpm = new BookkeeperPersistenceManager(bktb.bk, bktb.getZooKeeperClient(), tm, conf, scheduler);
    }
View Full Code Here

        return 1;
    }

    @Override
    PersistenceManager instantiatePersistenceManager() throws Exception {
        ServerConfiguration conf = new ServerConfiguration();
        ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);

        return new BookkeeperPersistenceManager(bktb.bk, bktb.getZooKeeperClient(), new TrivialOwnAllTopicManager(conf,
                                                scheduler), conf, scheduler);
    }
View Full Code Here

        NIOServerCnxnFactory serverFactory = new NIOServerCnxnFactory();
        serverFactory.configure(new InetSocketAddress(2181), 100);
        serverFactory.startup(zks);

        boolean b = ClientBase.waitForServerUp("127.0.0.1:2181", 5000);
        ServerConfiguration serverConf = new ServerConfiguration();
        serverConf.loadConf(hedwigConfigFile.toURI().toURL());

        logger.info("Zookeeper server up and running!");

        ZooKeeper zkc = new ZooKeeper("127.0.0.1", 2181, null);
View Full Code Here

    }

    @Override
    @Before
    public void setUp() throws Exception {
        ServerConfiguration conf = new ServerConfiguration();
        tm = new StubTopicManager(conf);
        handler = new MyBaseHandler(tm, conf);
        request = PubSubRequest.getDefaultInstance();
        channel = new WriteRecordingChannel();
    }
View Full Code Here

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        cfg = new ServerConfiguration();
        me = cfg.getServerAddr();
        scheduler = Executors.newSingleThreadScheduledExecutor();
        tm = new ZkTopicManager(zk, cfg, scheduler);
    }
View Full Code Here

        }
    }

    @Test
    public void testGetOwnerMulti() throws Exception {
        ServerConfiguration cfg1 = new CustomServerConfiguration(cfg.getServerPort() + 1), cfg2 = new CustomServerConfiguration(
            cfg.getServerPort() + 2);
        // TODO change cfg1 cfg2 params
        ZkTopicManager tm1 = new ZkTopicManager(zk, cfg1, scheduler), tm2 = new ZkTopicManager(zk, cfg2, scheduler);

        tm.getOwner(topic, false, addrCbq, null);
        HedwigSocketAddress owner = check(addrCbq.take());

        // If we were told to have another person claim the topic, make them
        // claim the topic.
        if (owner.getPort() == cfg1.getServerPort())
            tm1.getOwner(topic, true, addrCbq, null);
        else if (owner.getPort() == cfg2.getServerPort())
            tm2.getOwner(topic, true, addrCbq, null);
        if (owner.getPort() != cfg.getServerPort())
            Assert.assertEquals(owner, check(addrCbq.take()));
View Full Code Here

    public void testLoadBalancing() throws Exception {
        tm.getOwner(topic, false, addrCbq, null);

        Assert.assertEquals(me, check(addrCbq.take()));

        ServerConfiguration cfg1 = new CustomServerConfiguration(cfg.getServerPort() + 1);
        new ZkTopicManager(zk, cfg1, scheduler);

        ByteString topic1 = mkTopic(1);
        tm.getOwner(topic1, false, addrCbq, null);
        Assert.assertEquals(cfg1.getServerAddr(), check(addrCbq.take()));

    }
View Full Code Here

     * @param args
     */
    public static void main(String[] args) {

        logger.info("Attempting to start Hedwig");
        ServerConfiguration conf = new ServerConfiguration();
        if (args.length > 0) {
            String confFile = args[0];
            try {
                conf.loadConf(new File(confFile).toURI().toURL());
            } catch (MalformedURLException e) {
                String msg = "Could not open configuration file: " + confFile;
                errorMsgAndExit(msg, e, RC_INVALID_CONF_FILE);
            } catch (ConfigurationException e) {
                String msg = "Malformed configuration file: " + confFile;
View Full Code Here

TOP

Related Classes of org.apache.hedwig.server.common.ServerConfiguration

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.