use of org.nustaq.reallive.impl.actors.ShardFunc in project kontraktor by RuedigerMoeller.
the class Basic method testActorShard.
@Test
public void testActorShard() throws InterruptedException {
RealLiveTableActor[] rls = new RealLiveTableActor[8];
for (int i = 0; i < rls.length; i++) {
rls[i] = Actors.AsActor(RealLiveTableActor.class);
rls[i].init(() -> new OffHeapRecordStorage(32, 500 / rls.length, 700_000 / rls.length), null);
}
ShardFunc sfunc = key -> Math.abs(key.hashCode()) % rls.length;
TableSharding sharding = new TableSharding(sfunc, rls, null);
TA ta = Actors.AsActor(TA.class);
// while( System.currentTimeMillis() != 0)
{
ta.runTest(sharding).await(50009);
}
ta.stop();
sharding.stop();
}
Aggregations