use of org.nustaq.reallive.impl.tablespace.TableSpaceActor in project kontraktor by RuedigerMoeller.
the class TableSpaceTest method simpleRemote.
@Test
public void simpleRemote() {
TableSpaceActor ts = startServer();
Assert.assertTrue(runSimpleTest(ts, () -> createTableDescription()) == EXPECT_SIMPLECOUNT);
ts.close();
ts.shutDown().await();
}
use of org.nustaq.reallive.impl.tablespace.TableSpaceActor in project kontraktor by RuedigerMoeller.
the class TableSpaceTest method startShardServer.
@Test
public void startShardServer() throws InterruptedException {
startServer();
TableSpaceActor ts = Actors.AsActor(TableSpaceActor.class);
ts.init();
new TCPNIOPublisher(ts, 5433).publish(actor -> System.out.println("sidconnected: " + actor));
Thread.sleep(1000000);
}
use of org.nustaq.reallive.impl.tablespace.TableSpaceActor in project kontraktor by RuedigerMoeller.
the class TableSpaceTest method simpleSharded.
@Test
public void simpleSharded() {
TableSpaceActor[] spaces = { Actors.AsActor(TableSpaceActor.class), Actors.AsActor(TableSpaceActor.class) };
for (int i = 0; i < spaces.length; i++) {
TableSpaceActor space = spaces[i];
space.init();
}
TableSpaceSharding ts = new TableSpaceSharding(spaces, key -> Math.abs(key.hashCode()) % spaces.length);
Assert.assertTrue(runSimpleTest(ts, () -> createShardedTableDescription()) == EXPECT_SIMPLECOUNT);
ts.shutDown().await();
}
use of org.nustaq.reallive.impl.tablespace.TableSpaceActor in project kontraktor by RuedigerMoeller.
the class TableSpaceTest method simpleShardedNoServer.
@Test
public void simpleShardedNoServer() {
TableSpaceActor[] spaces = { null, null };
spaces[0] = (TableSpaceActor) new TCPConnectable(TableSpaceActor.class, "localhost", 5432).connect((disc, err) -> System.out.println("client disc " + disc + " " + err)).await();
spaces[1] = (TableSpaceActor) new TCPConnectable(TableSpaceActor.class, "localhost", 5433).connect((disc, err) -> System.out.println("client disc " + disc + " " + err)).await();
for (int i = 0; i < spaces.length; i++) {
TableSpaceActor space = spaces[i];
space.init();
}
TableSpaceSharding ts = new TableSpaceSharding(spaces, key -> Math.abs(key.hashCode()) % spaces.length);
Assert.assertTrue(runSimpleTest(ts, () -> createShardedTableDescription()) == EXPECT_SIMPLECOUNT);
ts.shutDown().await();
}
use of org.nustaq.reallive.impl.tablespace.TableSpaceActor in project kontraktor by RuedigerMoeller.
the class TableSpaceTest method startServer.
public TableSpaceActor startServer() {
TableSpaceActor ts = Actors.AsActor(TableSpaceActor.class);
ts.init();
new TCPNIOPublisher(ts, 5432).publish(actor -> System.out.println("sidconnected: " + actor));
return ts;
}
Aggregations