Search in sources :

Example 1 with PersistenceConfig

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());
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) PersistenceConfig(com.yahoo.vespa.config.content.PersistenceConfig) ContentCluster(com.yahoo.vespa.model.content.cluster.ContentCluster) Test(org.junit.Test)

Aggregations

MockRoot (com.yahoo.config.model.test.MockRoot)1 PersistenceConfig (com.yahoo.vespa.config.content.PersistenceConfig)1 ContentCluster (com.yahoo.vespa.model.content.cluster.ContentCluster)1 Test (org.junit.Test)1