Examples of HedwigSocketAddress


Examples of org.apache.hedwig.util.HedwigSocketAddress

                        cb.operationFailed(ctx, new PubSubException.ServiceDownException(e));
                        return;
                    }

                    // successfully did a read
                    HedwigSocketAddress owner = new HedwigSocketAddress(new String(data));
                    if (!owner.equals(addr)) {
                        if (logger.isDebugEnabled()) {
                            logger.debug("topic: " + topic.toStringUtf8() + " belongs to someone else: " + owner);
                        }
                        cb.operationFinished(ctx, owner);
                        return;
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

                public int getConsumedMessagesBufferSize() {
                    return 1;
                }
                @Override
                protected HedwigSocketAddress getDefaultServerHedwigSocketAddress() {
                    return new HedwigSocketAddress(connectString);
                }
            };
            client = new org.apache.hedwig.client.HedwigClient(conf);
            publisher = client.getPublisher();
            subscriber = client.getSubscriber();
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

        // host/VIP to repost the request.
        String statusMsg = response.getStatusMsg();
        InetSocketAddress redirectedHost;
        if (statusMsg != null && statusMsg.length() > 0) {
            if (cfg.isSSLEnabled()) {
                redirectedHost = new HedwigSocketAddress(statusMsg).getSSLSocketAddress();
            } else {
                redirectedHost = new HedwigSocketAddress(statusMsg).getSocketAddress();
            }
        } else {
            redirectedHost = cfg.getDefaultServerHost();
        }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

    // This should point to the default server host, or the VIP fronting all of
    // the server hubs. This will return the HedwigSocketAddress which
    // encapsulates both the regular and SSL port connection to the server host.
    protected HedwigSocketAddress getDefaultServerHedwigSocketAddress() {
        if (myDefaultServerAddress == null)
            myDefaultServerAddress = new HedwigSocketAddress(conf.getString(DEFAULT_SERVER_HOST, "localhost:4080:9876"));
        return myDefaultServerAddress;
    }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

    // Default ClientConfiguration to use. This just points to the first
    // Hedwig hub server in each region as the "default server host" to connect
    // to.
    protected class RegionClientConfiguration extends ClientConfiguration {
        public RegionClientConfiguration(int serverPort, int sslServerPort) {
            myDefaultServerAddress = new HedwigSocketAddress("localhost:" + serverPort + ":" + sslServerPort);
        }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

            }
        }

        protected boolean describeTopic(String topic) throws Exception {
            ByteString btopic = ByteString.copyFromUtf8(topic);
            HedwigSocketAddress owner = admin.getTopicOwner(btopic);
            List<LedgerRange> ranges = admin.getTopicLedgers(btopic);
            Map<ByteString, SubscriptionState> states = admin.getTopicSubscriptions(btopic);

            System.out.println("===== Topic Information : " + topic + " =====");
            System.out.println();
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

                public int getConsumedMessagesBufferSize() {
                    return 1;
                }
                @Override
                protected HedwigSocketAddress getDefaultServerHedwigSocketAddress() {
                    return new HedwigSocketAddress(connectString);
                }
            };
            client = new org.apache.hedwig.client.HedwigClient(conf);
            publisher = client.getPublisher();
            subscriber = client.getSubscriber();
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

        regionHubAddresses = new HashMap<Integer, List<HedwigSocketAddress>>(numRegions, 1.0f);
        for (int i = 0; i < numRegions; i++) {
            List<HedwigSocketAddress> addresses = new LinkedList<HedwigSocketAddress>();
            for (int j = 0; j < numServersPerRegion; j++) {
                HedwigSocketAddress a = new HedwigSocketAddress("localhost",
                        PortManager.nextFreePort(), PortManager.nextFreePort());
                addresses.add(a);
            }
            regionHubAddresses.put(i, addresses);
        }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

        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++) {
            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();
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

    // Default ClientConfiguration to use. This just points to the first
    // Hedwig hub server in each region as the "default server host" to connect
    // to.
    protected class RegionClientConfiguration extends ClientConfiguration {
        public RegionClientConfiguration(int serverPort, int sslServerPort) {
            myDefaultServerAddress = new HedwigSocketAddress("localhost:" + serverPort + ":" + sslServerPort);
        }
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.