Search in sources :

Example 1 with ConsistentHashV2

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

the class ConsistentHashPerformanceTest method testVariousVersion1.

public void testVariousVersion1() {
    ConsistentHashV2 dch2 = new ConsistentHashV2();
    initConsistentHash(dch2);
    testConsistentHashSpeed(dch2);
}
Also used : ConsistentHashV2(org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashV2)

Example 2 with ConsistentHashV2

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

the class ConsistentHashV2Test method setUp.

private void setUp(int numOwners) {
    a1 = new InetSocketAddress(1);
    a2 = new InetSocketAddress(2);
    a3 = new InetSocketAddress(3);
    a4 = new InetSocketAddress(4);
    LinkedHashMap<SocketAddress, Set<Integer>> map = new LinkedHashMap<SocketAddress, Set<Integer>>();
    map.put(a1, Collections.singleton(0));
    map.put(a2, Collections.singleton(1000));
    map.put(a3, Collections.singleton(2000));
    map.put(a4, Collections.singleton(3000));
    this.v1 = new ConsistentHashV2();
    this.v1.init(map, numOwners, 10000);
    hash = new DummyHash();
    this.v1.setHash(hash);
}
Also used : Set(java.util.Set) InetSocketAddress(java.net.InetSocketAddress) ConsistentHashV2(org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashV2) SocketAddress(java.net.SocketAddress) InetSocketAddress(java.net.InetSocketAddress) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ConsistentHashV2 (org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashV2)2 InetSocketAddress (java.net.InetSocketAddress)1 SocketAddress (java.net.SocketAddress)1 LinkedHashMap (java.util.LinkedHashMap)1 Set (java.util.Set)1