Package com.linkedin.d2.balancer.util.partitions

Examples of com.linkedin.d2.balancer.util.partitions.PartitionAccessException


  public static void testBuildAllPartitionsRequest(RestliRequestOptions options) throws ServiceUnavailableException, URISyntaxException, RestException
  {

    final int PARTITION_NUM = 10;

    ConsistentHashKeyMapper mapper = getKeyToHostMapper(PARTITION_NUM);

    AllPartitionsRequestBuilder<CollectionResponse<Greeting>> searchRB = new AllPartitionsRequestBuilder<CollectionResponse<Greeting>>(mapper);
    FindRequestBuilder<Long, Greeting> findRB = new FindRequestBuilder<Long, Greeting>(TEST_URI,
                                                                                       Greeting.class,
                                                                                       _COLL_SPEC,
View Full Code Here


  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "restliRequestOptions")
  public static void testSendAllPartitionsRequests(RestliRequestOptions options) throws ServiceUnavailableException, URISyntaxException, RestException, InterruptedException
  {
    final int PARTITION_NUM = 10;
    ConsistentHashKeyMapper mapper = getKeyToHostMapper(PARTITION_NUM);
    AllPartitionsRequestBuilder<Greeting> searchRB = new AllPartitionsRequestBuilder<Greeting>(mapper);
    ActionRequestBuilder<Long, Greeting> builder = new ActionRequestBuilder<Long, Greeting>(TEST_URI,
                                                                                            Greeting.class,
                                                                                            _COLL_SPEC,
                                                                                            options);
View Full Code Here

    {
      final ConsistentHashRing<URI> ring = new ConsistentHashRing<URI>(map);
      rings.add(ring);
    }

    return new ConsistentHashKeyMapper(new StaticRingProvider(rings), new TestPartitionInfoProvider());
  }
View Full Code Here

    {
      final ConsistentHashRing<URI> ring = new ConsistentHashRing<URI>(map);
      rings.add(ring);
    }

    return new ConsistentHashKeyMapper(new StaticRingProvider(rings), new TestPartitionInfoProvider());
  }
View Full Code Here

      else if (i == 3)
      {
        return 3;
      }
      else
        throw new PartitionAccessException("No partition for this");
    }
View Full Code Here

        else if (i == 100 || i == 101 || i == 102)
        {
          return 3;
        }
        else
          throw new PartitionAccessException("No partition for this");
      }

      @Override
      public int getMaxPartitionId()
      {
View Full Code Here

      else if (i >= 13 && i <= 15)
      {
        return 4;
      }
      else
        throw new PartitionAccessException("No partition for this");
    }
View Full Code Here

  private ZKFSLoadBalancer.TogglingLoadBalancerFactory createLoadBalancerFactory(D2ClientConfig config)
  {
    final ZKFSTogglingLoadBalancerFactoryImpl.ComponentFactory loadBalancerComponentFactory;
    if (config.componentFactory == null)
    {
      loadBalancerComponentFactory = new ZKFSComponentFactory();
    }
    else
    {
      loadBalancerComponentFactory = config.componentFactory;
    }
View Full Code Here

{

  @Override
  public LoadBalancerWithFacilities create(D2ClientConfig config)
  {
    return  new ZKFSLoadBalancer(config.zkHosts,
                                    (int) config.zkSessionTimeoutInMs,
                                    (int) config.zkStartupTimeoutInMs,
                                    createLoadBalancerFactory(config),
                                    config.flagFile,
                                    config.basePath,
View Full Code Here

    }

    final Map<String, LoadBalancerStrategyFactory<? extends LoadBalancerStrategy>> loadBalancerStrategyFactories =
        createDefaultLoadBalancerStrategyFactories();

    return new ZKFSTogglingLoadBalancerFactoryImpl(loadBalancerComponentFactory,
                                                   config.lbWaitTimeout,
                                                   config.lbWaitUnit,
                                                   config.basePath,
                                                   config.fsBasePath,
                                                   config.clientFactories,
View Full Code Here

TOP

Related Classes of com.linkedin.d2.balancer.util.partitions.PartitionAccessException

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.