Package com.linkedin.d2.balancer

Examples of com.linkedin.d2.balancer.ServiceUnavailableException


    @Override
    public TransportClient getClient(Request request, RequestContext requestContext) throws ServiceUnavailableException
    {
      if (_serviceUnavailable)
      {
        throw new ServiceUnavailableException("bad", "bad");
      }

      return new TestClient();
    }
View Full Code Here


      {
        new TransportClientAdapter(client).restRequest(request, requestContext, transportCallback);
      }
      else
      {
        throw new ServiceUnavailableException("unknown: " + request.getURI(),
                                              "got null client from load balancer");
      }
    }
    catch (ServiceUnavailableException e)
    {
View Full Code Here

      {
        new TransportClientAdapter(client).rpcRequest(request, requestContext, callback);
      }
      else
      {
        throw new ServiceUnavailableException("unknown: " + request.getURI(),
                                              "got null client from load balancer");
      }
    }
    catch (ServiceUnavailableException e)
    {
View Full Code Here

      }
    }

    if (hostUris.isEmpty())
    {
      throw new ServiceUnavailableException(serviceUri.getAuthority(), "No valid target host uri found for: " + serviceUri.toString());
    }

    return new AllPartitionsResult<URI>(hostUris, ringMap.size(), missingPartitions);
  }
View Full Code Here

  public <K> MapKeyResult<Ring<URI>, K> getRings(URI serviceUri, Iterable<K> keys)
      throws ServiceUnavailableException
  {
    if (_rings.size() < 1)
    {
      throw new ServiceUnavailableException("Ring not configured:", serviceUri.toString());
    }

    Map<Ring<URI>, Collection<K>> result = new HashMap<Ring<URI>, Collection<K>>();
    List<MapKeyResult.UnmappedKey<K>> unmappedKeys = new ArrayList<MapKeyResult.UnmappedKey<K>>();
    for (K key : keys)
View Full Code Here

      return new MapKeyResult<Ring<URI>, K>(ringMap, unmappedKeys);
    }
    else
    {
      throw new ServiceUnavailableException(serviceName, "Unable to find a load balancer strategy");
    }
  }
View Full Code Here

      }
      return ringMap;
    }
    else
    {
      throw new ServiceUnavailableException(serviceName, "Unable to find a load balancer strategy");
    }
  }
View Full Code Here

        }
      }
    }
    else
    {
      throw new ServiceUnavailableException(serviceName, "Unable to find a load balancer strategy");
    }
    return new AllPartitionsMultipleHostsResult<URI>(hostList, maxPartitionId + 1, partitionWithoutEnoughHost);
  }
View Full Code Here

      }
      return new MapKeyHostPartitionResult<K>(unmappedKeys, partitionDataMap, partitionWithoutEnoughHost);
    }
    else
    {
      throw new ServiceUnavailableException(serviceName, "Unable to find a load balancer strategy");
    }
  }
View Full Code Here

  private void die(String serviceName, String message) throws ServiceUnavailableException
  {
    _serviceUnavailableStats.inc();

    throw new ServiceUnavailableException(serviceName, message);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.d2.balancer.ServiceUnavailableException

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.