Search in sources :

Example 1 with ConsistentHashFactory

use of org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory in project infinispan by infinispan.

the class ConsistentHashFactoryTest method testNoChDefined.

public void testNoChDefined() {
    ConfigurationBuilder builder = HotRodClientTestingUtil.newRemoteConfigurationBuilder();
    ConsistentHashFactory chf = new ConsistentHashFactory();
    chf.init(builder.build());
    ConsistentHash hash = chf.newConsistentHash(2);
    assertNotNull(hash);
    assertEquals(hash.getClass(), ConsistentHashV2.class);
}
Also used : ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) ConsistentHash(org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash) ConsistentHashFactory(org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory)

Example 2 with ConsistentHashFactory

use of org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory in project infinispan by infinispan.

the class ConsistentHashFactoryTest method testPropertyCorrectlyRead.

public void testPropertyCorrectlyRead() {
    ConfigurationBuilder builder = HotRodClientTestingUtil.newRemoteConfigurationBuilder();
    builder.consistentHashImpl(2, SomeCustomConsistentHashV2.class);
    ConsistentHashFactory chf = new ConsistentHashFactory();
    chf.init(builder.build());
    ConsistentHash hash = chf.newConsistentHash(2);
    assertNotNull(hash);
    assertEquals(hash.getClass(), SomeCustomConsistentHashV2.class);
}
Also used : ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) ConsistentHash(org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash) ConsistentHashFactory(org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory)

Aggregations

ConfigurationBuilder (org.infinispan.client.hotrod.configuration.ConfigurationBuilder)2 ConsistentHash (org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash)2 ConsistentHashFactory (org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory)2