Examples of KeyMapper


Examples of com.linkedin.d2.balancer.KeyMapper

        keys.add(ii);
      }

      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

  @Test(dataProvider = "requestBuilderDataProvider")
  public static void testScatterGatherLoadBalancerIntegration(RootBuilderWrapper<Long, Greeting> builders) throws Exception
  {
    SimpleLoadBalancer loadBalancer = MockLBFactory.createLoadBalancer();

    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

  @Test(dataProvider = "requestBuilderDataProvider")
  public static void testScatterGatherKVLoadBalancerIntegration(RootBuilderWrapper<Long, Greeting> builders) throws Exception
  {
    SimpleLoadBalancer loadBalancer = MockLBFactory.createLoadBalancer();

    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

  @Test(dataProvider = "requestBuilderDataProvider")
  public static void testScatterGatherEntityLoadBalancerIntegration(RootBuilderWrapper<Long, Greeting> builders) throws Exception
  {
    SimpleLoadBalancer loadBalancer = MockLBFactory.createLoadBalancer();

    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.threed.jpct.util.KeyMapper

  public SpaceCamera2(World world, GameConfig config){
    setCamera(world.getCamera());
    setDefaultScene()
   
   
    keyMapper = new KeyMapper();
    this.config = config;
    distance = config.getDefaultCameraDist();
    setDefaultPosition();
    lookAtCenter();
  }
View Full Code Here

Examples of com.vaadin.terminal.KeyMapper

        if (actionHandler != null) {

            if (actionHandlers == null) {
                actionHandlers = new LinkedList<Action.Handler>();
                actionMapper = new KeyMapper();
            }

            if (!actionHandlers.contains(actionHandler)) {
                actionHandlers.add(actionHandler);
                requestRepaint();
View Full Code Here

Examples of com.vaadin.terminal.KeyMapper

        if (actionHandler != null) {

            if (actionHandlers == null) {
                actionHandlers = new LinkedList<Handler>();
                actionMapper = new KeyMapper();
            }

            if (!actionHandlers.contains(actionHandler)) {
                actionHandlers.add(actionHandler);
                refreshRenderedCells();
View Full Code Here

Examples of com.vaadin.terminal.KeyMapper

        if (actionHandler != null) {

            if (actionHandlers == null) {
                actionHandlers = new LinkedList<Handler>();
                actionMapper = new KeyMapper();
            }

            if (!actionHandlers.contains(actionHandler)) {
                actionHandlers.add(actionHandler);
                requestRepaint();
View Full Code Here

Examples of com.vaadin.terminal.KeyMapper

        if (actionHandler != null) {

            if (actionHandlers == null) {
                actionHandlers = new LinkedList<Action.Handler>();
                actionMapper = new KeyMapper();
            }

            if (!actionHandlers.contains(actionHandler)) {
                actionHandlers.add(actionHandler);
                requestRepaint();
View Full Code Here

Examples of com.vaadin.terminal.KeyMapper

        /*
         * Must repaint whenever there are actions OR if all actions have been
         * removed but still exist on client side
         */
        if (!actions.isEmpty() || clientHasActions) {
            actionMapper = new KeyMapper();

            paintTarget.addVariable(viewer, "action", "");
            paintTarget.startTag("actions");

            for (final Action a : actions) {
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.