use of herddb.server.ServerConfiguration in project herddb by diennea.
the class AlterTablespaceSQLTest method defaultReplicaCount.
@Test
public void defaultReplicaCount() throws Exception {
String nodeId = "localhost";
ServerConfiguration config = newServerConfigurationWithAutoPort();
config.set(ServerConfiguration.PROPERTY_DEFAULT_REPLICA_COUNT, "4");
try (DBManager manager = new DBManager(nodeId, new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null, config, NullStatsLogger.INSTANCE)) {
manager.start();
assertTrue(manager.waitForTablespace(TableSpace.DEFAULT, 10000));
execute(manager, "CREATE TABLESPACE myts", Collections.emptyList());
assertEquals(4, manager.getMetadataStorageManager().describeTableSpace("myts").expectedReplicaCount);
}
// default ServerConfiguration, defaults to 1
try (DBManager manager = new DBManager(nodeId, new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {
manager.start();
assertTrue(manager.waitForTablespace(TableSpace.DEFAULT, 10000));
execute(manager, "CREATE TABLESPACE myts", Collections.emptyList());
assertEquals(1, manager.getMetadataStorageManager().describeTableSpace("myts").expectedReplicaCount);
}
}
Aggregations