Search in sources :

Example 1 with IntArrayCuckoo

use of com.ms.silverking.cloud.dht.collection.IntArrayCuckoo in project SilverKing by Morgan-Stanley.

the class IntRehashTest method rehashTest.

public static void rehashTest(int size) {
    IntArrayCuckoo map;
    map = new IntArrayCuckoo(new WritableCuckooConfig(totalEntries, numSubTables, entriesPerBucket, cuckooLimit));
    for (int i = 0; i < size; i++) {
        try {
            map.put(new SimpleKey(0, i), i);
        } catch (TableFullException tfe) {
            System.out.println("rehashing");
            map = IntArrayCuckoo.rehashAndAdd(map, new SimpleKey(0, i), i);
        }
    }
}
Also used : TableFullException(com.ms.silverking.cloud.dht.collection.TableFullException) IntArrayCuckoo(com.ms.silverking.cloud.dht.collection.IntArrayCuckoo) WritableCuckooConfig(com.ms.silverking.cloud.dht.collection.WritableCuckooConfig) SimpleKey(com.ms.silverking.cloud.dht.common.SimpleKey)

Aggregations

IntArrayCuckoo (com.ms.silverking.cloud.dht.collection.IntArrayCuckoo)1 TableFullException (com.ms.silverking.cloud.dht.collection.TableFullException)1 WritableCuckooConfig (com.ms.silverking.cloud.dht.collection.WritableCuckooConfig)1 SimpleKey (com.ms.silverking.cloud.dht.common.SimpleKey)1