Package com.alibaba.dubbo.rpc.cluster

Examples of com.alibaba.dubbo.rpc.cluster.LoadBalance.select()


    }
   
    @Test
    public void testCloseAvailablecheck(){
        LoadBalance lb = EasyMock.createMock(LoadBalance.class);
        EasyMock.expect(lb.select(invokers, url, invocation)).andReturn(invoker1);
        EasyMock.replay(lb);
        initlistsize5();
       
        Invoker sinvoker = cluster_nocheck.select(lb, invocation, invokers, selectedInvokers);
        Assert.assertEquals(false,sinvoker.isAvailable());
View Full Code Here


        LoadBalance lb = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(loadbalanceName);
        for(Invoker invoker :invokers){
            counter.put(invoker, new AtomicLong(0));
        }
        for(int i=0;i<runs;i++){
            Invoker sinvoker = lb.select(invokers, invokers.get(0).getUrl(), invocation);
            counter.get(sinvoker).incrementAndGet();
        }
        return counter;
    }
   
View Full Code Here

            name = url.getParameter(Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE);
        } else {
            name = url.getMethodParameter(method, Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE);
        }
        LoadBalance loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(name);
        return loadbalance.select(invokers, invocation);
    }
}
View Full Code Here

            name = url.getParameter(Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE);
        } else {
            name = url.getMethodParameter(method, Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE);
        }
        LoadBalance loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(name);
        return loadbalance.select(invokers, invocation);
    }

}
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.