use of com.yahoo.vespa.config.content.PersistenceConfig in project vespa by vespa-engine.
the class StorageClusterTest method testGenericPersistenceTuning.
@Test
public void testGenericPersistenceTuning() throws Exception {
String xml = "<cluster id=\"storage\">\n" + "<documents/>" + "<engine>\n" + " <fail-partition-on-error>true</fail-partition-on-error>\n" + " <revert-time>34m</revert-time>\n" + " <recovery-time>5d</recovery-time>\n" + "</engine>" + " <group>\n" + " <node distribution-key=\"0\" hostalias=\"mockhost\"/>\n" + " </group>\n" + "</cluster>";
ContentCluster cluster = ContentClusterUtils.createCluster(xml, new MockRoot());
PersistenceConfig.Builder builder = new PersistenceConfig.Builder();
cluster.getStorageNodes().getConfig(builder);
PersistenceConfig config = new PersistenceConfig(builder);
assertEquals(true, config.fail_partition_on_error());
assertEquals(34 * 60, config.revert_time_period());
assertEquals(5 * 24 * 60 * 60, config.keep_remove_time_period());
}
Aggregations