Examples of PubSubServer


Examples of org.apache.hedwig.server.netty.PubSubServer

        // initialize the zk client with (fake) values
        zkc.create("/ledgers", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
        zkc.create("/ledgers/available", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);

        zkc.close();
        PubSubServer hedwigServer = null;
        try {
            logger.info("starting hedwig broker!");
            hedwigServer = new PubSubServer(serverConf);
        } catch (Exception e) {
            e.printStackTrace();
        }
        Assert.assertNotNull("failed to instantiate hedwig pub sub server", hedwigServer);

        hedwigServer.shutdown();
        serverFactory.shutdown();

        zks.shutdown();

        zkTmpDir.delete();
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

            List<PubSubServer> serversList = new LinkedList<PubSubServer>();
            // For the current region, create the necessary amount of hub
            // servers. We will basically increment through the port numbers
            // starting from the initial ones defined.
            for (int j = 0; j < numServersPerRegion; j++) {
                serversList.add(new PubSubServer(getServerConfiguration(initialServerPort
                                                 + (j + i * numServersPerRegion), initialSSLServerPort + (j + i * numServersPerRegion),
                                                 REGION_PREFIX + i)));
            }
            // Store this list of servers created for the current region
            regionServersMap.put(REGION_PREFIX + i, serversList);
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

        bktb = new BookKeeperTestBase(numBookies);
        bktb.setUp();
        // Now create the PubSubServer Hubs
        serversList = new LinkedList<PubSubServer>();
        for (int i = 0; i < numServers; i++) {
            serversList.add(new PubSubServer(getServerConfiguration(initialServerPort + i, initialSSLServerPort + i)));
        }
        logger.info("HedwigHub test setup finished");
    }
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

    @Override
    @Before
    public void setUp() throws Exception {
        logger.info("STARTING " + getName());
        server = new PubSubServer(new StandAloneServerConfiguration());
        logger.info("Standalone PubSubServer test setup finished");
    }
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

        }
    }

    private void sleepDeliveryManager(final CountDownLatch wakeupLatch)
            throws IOException {
        PubSubServer server = serversList.get(0);
        assertNotNull("There should be at least one pubsub server", server);
        DeliveryManager dm = server.getDeliveryManager();
        assertNotNull("Delivery manager should not be null once server has started", dm);
        assertTrue("Delivery manager is wrong type", dm instanceof FIFODeliveryManager);
        final FIFODeliveryManager fdm = (FIFODeliveryManager)dm;

        Thread sleeper = new Thread() {
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

        // initialize the zk client with (fake) values
        zkc.create("/ledgers", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
        zkc.create("/ledgers/available", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);

        zkc.close();
        PubSubServer hedwigServer = null;
        try {
            logger.info("starting hedwig broker!");
            hedwigServer = new PubSubServer(serverConf);
            hedwigServer.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
        Assert.assertNotNull("failed to instantiate hedwig pub sub server", hedwigServer);

        hedwigServer.shutdown();
        serverFactory.shutdown();

        zks.shutdown();

        zkTmpDir.delete();
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

        List<PubSubServer> serversList = new LinkedList<PubSubServer>();
        // For the current region, create the necessary amount of hub
        // servers. We will basically increment through the port numbers
        // starting from the initial ones defined.
        for (int j = 0; j < numServersPerRegion; j++) {
            PubSubServer s = new PubSubServer(
                    getServerConfiguration(initialServerPort
                                           + (j + i * numServersPerRegion),
                                           initialSSLServerPort + (j + i * numServersPerRegion),
                                           regionName));
            serversList.add(s);
            s.start();
        }
        // Store this list of servers created for the current region
        regionServersMap.put(regionName, serversList);
        // Create a Hedwig Client that points to the first Hub server
        // created in the loop above for the current region.
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

    protected void startHubServers() throws Exception {
        // Now create the PubSubServer Hubs
        serversList = new LinkedList<PubSubServer>();
        for (int i = 0; i < numServers; i++) {
            PubSubServer s = new PubSubServer(
                    getServerConfiguration(initialServerPort + i, initialSSLServerPort + i));
            serversList.add(s);
            s.start();
        }
    }
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

    @Override
    @Before
    public void setUp() throws Exception {
        logger.info("STARTING " + getName());
        server = new PubSubServer(new StandAloneServerConfiguration());
        server.start();
        logger.info("Standalone PubSubServer test setup finished");
    }
View Full Code Here

Examples of org.apache.hedwig.server.netty.PubSubServer

        // For the current region, create the necessary amount of hub
        // servers. We will basically increment through the port numbers
        // starting from the initial ones defined.
        for (int j = 0; j < numServersPerRegion; j++) {
            HedwigSocketAddress a = regionHubAddresses.get(i).get(j);
            PubSubServer s = new PubSubServer(
                    getServerConfiguration(a.getPort(),
                                           a.getSSLPort(),
                                           regionName),
                    getRegionClientConfiguration(),
                    new LoggingExceptionHandler());
            serversList.add(s);
            s.start();
        }
        // Store this list of servers created for the current region
        regionServersMap.put(regionName, serversList);
        // Create a Hedwig Client that points to the first Hub server
        // created in the loop above for the current region.
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.