Examples of HedwigSocketAddress


Examples of org.apache.hedwig.util.HedwigSocketAddress

        } catch (KeeperException.NoNodeException nne) {
        }
        if (null == owner) {
            return null;
        }
        return new HedwigSocketAddress(new String(owner));
    }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

                                            "Failed to delete self-ownership node for topic: " + topic.toStringUtf8(), path, rc);
                    cb.operationFailed(ctx, new PubSubException.ServiceDownException(e));
                    return;
                }

                HedwigSocketAddress owner = new HedwigSocketAddress(new String(data));
                if (!owner.equals(addr)) {
                    logger.warn("Wanted to delete self-node for topic: " + topic.toStringUtf8() + " but node for "
                                + owner + " found, leaving untouched");
                    // Not our node, someone else's, leave it alone
                    cb.operationFinished(ctx, null);
                    return;
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

                         ScheduledExecutorService scheduler, HedwigHubClientFactory hubClientFactory) {
        this.pm = pm;
        mySubId = ByteString.copyFromUtf8(SubscriptionStateUtils.HUB_SUBSCRIBER_PREFIX + cfg.getMyRegion());
        queue = new TopicOpQueuer(scheduler);
        for (final String hub : cfg.getRegions()) {
            clients.add(hubClientFactory.create(new HedwigSocketAddress(hub)));
        }
        myRegion = cfg.getMyRegionByteString();
        if (cfg.getRetryRemoteSubscribeThreadRunInterval() > 0) {
            timer.schedule(new RetrySubscribeTask(), 0, cfg.getRetryRemoteSubscribeThreadRunInterval());
        }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

                            if (leastLoaded == null) {
                                cb.operationFailed(ZkGetOwnerOp.this.ctx, new PubSubException.ServiceDownException(
                                                       "No hub available"));
                                return;
                            }
                            HedwigSocketAddress owner = new HedwigSocketAddress(leastLoaded);
                            if (owner.equals(addr)) {
                                claim();
                            } else {
                                cb.operationFinished(ZkGetOwnerOp.this.ctx, owner);
                            }
                        }
View Full Code Here

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

    }

    protected void refreshMyServerAddress() {
        try {
            // Use the raw IP address as the hostname
            myServerAddress = new HedwigSocketAddress(InetAddress.getLocalHost().getHostAddress(), getServerPort(),
                    getSSLServerPort());
        } catch (UnknownHostException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.apache.hedwig.util.HedwigSocketAddress

        // Validate that if Regions exist and inter-region communication is SSL
        // enabled, that the Regions correspond to valid HedwigSocketAddresses,
        // namely that SSL ports are present.
        if (isInterRegionSSLEnabled() && getRegions().size() > 0) {
            for (String hubString : getRegions()) {
                HedwigSocketAddress hub = new HedwigSocketAddress(hubString);
                if (hub.getSSLSocketAddress() == null)
                    throw new ConfigurationException("Region defined does not have required SSL port: " + hubString);
            }
        }
        // Validate that the Bookkeeper ensemble size >= quorum size.
        if (getBkEnsembleSize() < getBkQuorumSize()) {
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.