Examples of mapKeys()


Examples of com.linkedin.d2.balancer.KeyMapper.mapKeys()

      for (int ii=0; ii<NUM_ITERATIONS; ++ii)
      {
        KeyMapper mapper = balancer.getKeyMapper();
        @SuppressWarnings("deprecation")
        Map<URI, Set<Integer>> batches = mapper.mapKeys(URI.create("d2://"+TEST_SERVICE_NAME), keys);
        Assert.assertEquals(batches.size(), 2);
        for (Map.Entry<URI, Set<Integer>> oneBatch : batches.entrySet())
        {
          Assert.assertTrue(oneBatch.getKey().toString().startsWith("http://test-host-"));
          Assert.assertTrue(keys.containsAll(oneBatch.getValue()));
View Full Code Here

Examples of com.linkedin.d2.balancer.KeyMapper.mapKeys()

    KeyMapper keyMapper = new ConsistentHashKeyMapper(loadBalancer, new TestPartitionInfoProvider());

    try
    {
      @SuppressWarnings("deprecation")
      Map<URI, Set<String>> result = keyMapper.mapKeys(URI.create("http://badurischeme/"), new HashSet<String>());
      Assert.fail("keyMapper should reject non-D2 URI scheme");
    }
    catch (IllegalArgumentException e)
    {
      //expected
View Full Code Here

Examples of com.linkedin.d2.balancer.KeyMapper.mapKeys()

    KeyMapper keyMapper = new ConsistentHashKeyMapper(loadBalancer, new TestPartitionInfoProvider());

    try
    {
      @SuppressWarnings("deprecation")
      Map<URI, Set<String>> result = keyMapper.mapKeys(URI.create("http://badurischeme/"), new HashSet<String>());
      Assert.fail("keyMapper should reject non-D2 URI scheme");
    }
    catch (IllegalArgumentException e)
    {
      //expected
View Full Code Here

Examples of com.linkedin.d2.balancer.KeyMapper.mapKeys()

    KeyMapper keyMapper = new ConsistentHashKeyMapper(loadBalancer, new TestPartitionInfoProvider());

    try
    {
      @SuppressWarnings("deprecation")
      Map<URI, Set<String>> result = keyMapper.mapKeys(URI.create("http://badurischeme/"), new HashSet<String>());
      Assert.fail("keyMapper should reject non-D2 URI scheme");
    }
    catch (IllegalArgumentException e)
    {
      //expected
View Full Code Here

Examples of com.linkedin.d2.balancer.util.hashing.ConsistentHashKeyMapper.mapKeys()

    KeyMapper keyMapper = new ConsistentHashKeyMapper(loadBalancer, new TestPartitionInfoProvider());

    try
    {
      @SuppressWarnings("deprecation")
      Map<URI, Set<String>> result = keyMapper.mapKeys(URI.create("http://badurischeme/"), new HashSet<String>());
      Assert.fail("keyMapper should reject non-D2 URI scheme");
    }
    catch (IllegalArgumentException e)
    {
      //expected
View Full Code Here

Examples of com.linkedin.d2.balancer.util.hashing.ConsistentHashKeyMapper.mapKeys()

    KeyMapper keyMapper = new ConsistentHashKeyMapper(loadBalancer, new TestPartitionInfoProvider());

    try
    {
      @SuppressWarnings("deprecation")
      Map<URI, Set<String>> result = keyMapper.mapKeys(URI.create("http://badurischeme/"), new HashSet<String>());
      Assert.fail("keyMapper should reject non-D2 URI scheme");
    }
    catch (IllegalArgumentException e)
    {
      //expected
View Full Code Here

Examples of com.linkedin.d2.balancer.util.hashing.ConsistentHashKeyMapper.mapKeys()

    KeyMapper keyMapper = new ConsistentHashKeyMapper(loadBalancer, new TestPartitionInfoProvider());

    try
    {
      @SuppressWarnings("deprecation")
      Map<URI, Set<String>> result = keyMapper.mapKeys(URI.create("http://badurischeme/"), new HashSet<String>());
      Assert.fail("keyMapper should reject non-D2 URI scheme");
    }
    catch (IllegalArgumentException e)
    {
      //expected
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.