Search in sources :

Example 1 with FixedServerBalancing

use of org.infinispan.client.hotrod.test.FixedServerBalancing in project infinispan by infinispan.

the class ReplicationIndexTest method createClient.

protected RemoteCacheManager createClient(int i) {
    HotRodServer server = server(i);
    org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = HotRodClientTestingUtil.newRemoteConfigurationBuilder();
    clientBuilder.addServer().host(server.getHost()).port(server.getPort()).marshaller(new ProtoStreamMarshaller()).balancingStrategy(() -> new FixedServerBalancing(server));
    return new InternalRemoteCacheManager(clientBuilder.build());
}
Also used : InternalRemoteCacheManager(org.infinispan.client.hotrod.test.InternalRemoteCacheManager) HotRodServer(org.infinispan.server.hotrod.HotRodServer) ProtoStreamMarshaller(org.infinispan.commons.marshall.ProtoStreamMarshaller) FixedServerBalancing(org.infinispan.client.hotrod.test.FixedServerBalancing)

Example 2 with FixedServerBalancing

use of org.infinispan.client.hotrod.test.FixedServerBalancing in project infinispan by infinispan.

the class StorageRoutingTest method createHotRodClientConfigurationBuilder.

@Override
protected org.infinispan.client.hotrod.configuration.ConfigurationBuilder createHotRodClientConfigurationBuilder(HotRodServer hotRodServer) {
    org.infinispan.client.hotrod.configuration.ConfigurationBuilder hotRodClientConfigurationBuilder = super.createHotRodClientConfigurationBuilder(hotRodServer);
    hotRodClientConfigurationBuilder.balancingStrategy(() -> new FixedServerBalancing(hotRodServer));
    return hotRodClientConfigurationBuilder;
}
Also used : FixedServerBalancing(org.infinispan.client.hotrod.test.FixedServerBalancing)

Aggregations

FixedServerBalancing (org.infinispan.client.hotrod.test.FixedServerBalancing)2 InternalRemoteCacheManager (org.infinispan.client.hotrod.test.InternalRemoteCacheManager)1 ProtoStreamMarshaller (org.infinispan.commons.marshall.ProtoStreamMarshaller)1 HotRodServer (org.infinispan.server.hotrod.HotRodServer)1