@Override public SocketAddress getHost(String key, RoutingContext rContext) throws NoBrokersAvailableException { if (rContext.isTriedHost(address)) { throw new NoBrokersAvailableException("No hosts is available : routing context = " + rContext); } return address; }
@Override public SocketAddress getHost(String key, RoutingContext rContext) throws NoBrokersAvailableException { SocketAddress host = circle.get(key, rContext); if (null != host) { return host; } throw new NoBrokersAvailableException("No host found for " + key + ", routing context : " + rContext); }
throw new NoBrokersAvailableException("No host is available.");
@Override public SocketAddress getHost(String key, RoutingContext routingContext) throws NoBrokersAvailableException { for (RoutingService service : routingServices) { try { SocketAddress addr = service.getHost(key, routingContext); if (routingContext.hasUnavailableRegions()) { // current region is unavailable String region = regionResolver.resolveRegion(addr); if (routingContext.isUnavailableRegion(region)) { continue; } } if (!routingContext.isTriedHost(addr)) { return addr; } } catch (NoBrokersAvailableException nbae) { // if there isn't broker available in current service, try next service. logger.debug("No brokers available in region {} : ", service, nbae); } } throw new NoBrokersAvailableException("No host found for " + key + ", routing context : " + routingContext); }
public RRMultiWriter(String[] streams, DistributedLogClient client) { this.streams = streams; this.client = client; scala.collection.immutable.Set<ServiceFactory<VALUE, DLSN>> scalaSet = JavaConversions.asScalaSet(initializeServices(streams, client)).toSet(); this.service = Balancers.heap(new scala.util.Random(System.currentTimeMillis())) .newBalancer( Activity.value(scalaSet), NullStatsReceiver.get(), new NoBrokersAvailableException("No partitions available") ).toService(); }
@Override public SocketAddress getHost(String key, RoutingContext rContext) throws NoBrokersAvailableException { SocketAddress host = circle.get(key, rContext); if (null != host) { return host; } throw new NoBrokersAvailableException("No host found for " + key + ", routing context : " + rContext); }
@Override public SocketAddress getHost(String key, RoutingContext rContext) throws NoBrokersAvailableException { SocketAddress host = circle.get(key, rContext); if (null != host) { return host; } throw new NoBrokersAvailableException("No host found for " + key + ", routing context : " + rContext); }
@Override public SocketAddress getHost(String key, RoutingContext rContext) throws NoBrokersAvailableException { if (rContext.isTriedHost(address)) { throw new NoBrokersAvailableException("No hosts is available : routing context = " + rContext); } return address; }
@Override public SocketAddress getHost(String key, RoutingContext rContext) throws NoBrokersAvailableException { if (rContext.isTriedHost(address)) { throw new NoBrokersAvailableException("No hosts is available : routing context = " + rContext); } return address; }
throw new NoBrokersAvailableException("No host is available.");
throw new NoBrokersAvailableException("No host is available.");
@Override public SocketAddress getHost(String key, RoutingContext routingContext) throws NoBrokersAvailableException { for (RoutingService service : routingServices) { try { SocketAddress addr = service.getHost(key, routingContext); if (routingContext.hasUnavailableRegions()) { // current region is unavailable String region = regionResolver.resolveRegion(addr); if (routingContext.isUnavailableRegion(region)) { continue; } } if (!routingContext.isTriedHost(addr)) { return addr; } } catch (NoBrokersAvailableException nbae) { // if there isn't broker available in current service, try next service. logger.debug("No brokers available in region {} : ", service, nbae); } } throw new NoBrokersAvailableException("No host found for " + key + ", routing context : " + routingContext); }
@Override public SocketAddress getHost(String key, RoutingContext routingContext) throws NoBrokersAvailableException { for (RoutingService service : routingServices) { try { SocketAddress addr = service.getHost(key, routingContext); if (routingContext.hasUnavailableRegions()) { // current region is unavailable String region = regionResolver.resolveRegion(addr); if (routingContext.isUnavailableRegion(region)) { continue; } } if (!routingContext.isTriedHost(addr)) { return addr; } } catch (NoBrokersAvailableException nbae) { // if there isn't broker available in current service, try next service. logger.debug("No brokers available in region {} : ", service, nbae); } } throw new NoBrokersAvailableException("No host found for " + key + ", routing context : " + routingContext); }
public RRMultiWriter(String[] streams, DistributedLogClient client) { this.streams = streams; this.client = client; scala.collection.immutable.Set<ServiceFactory<VALUE, DLSN>> scalaSet = JavaConversions.asScalaSet(initializeServices(streams, client)).toSet(); this.service = Balancers.heap(new scala.util.Random(System.currentTimeMillis())) .newBalancer( Activity.value(scalaSet), NullStatsReceiver.get(), new NoBrokersAvailableException("No partitions available") ).toService(); }
public RRMultiWriter(String[] streams, DistributedLogClient client) { this.streams = streams; this.client = client; scala.collection.immutable.Set<ServiceFactory<VALUE, DLSN>> scalaSet = JavaConversions.asScalaSet(initializeServices(streams, client)).toSet(); this.service = Balancers.heap(new scala.util.Random(System.currentTimeMillis())) .newBalancer( Activity.value(scalaSet), NullStatsReceiver.get(), new NoBrokersAvailableException("No partitions available") ).toService(); }