Search in sources :

Example 1 with AutoVacuumConfig

use of io.prestosql.vacuum.AutoVacuumConfig in project hetu-core by openlookeng.

the class TestAutoVacuumConfig method testExplicitPropertyMappings.

@Test
public void testExplicitPropertyMappings() {
    Map<String, String> properties = new ImmutableMap.Builder<String, String>().put("auto-vacuum.enabled", "true").put("auto-vacuum.scan.interval", "15m").put("auto-vacuum.scan.threads", "0").build();
    AutoVacuumConfig expected = new AutoVacuumConfig();
    try {
        newInstance(expected.getClass(), properties);
    } catch (Exception e) {
        assertTrue(e.getMessage().contains("auto-vacuum.scan.threads: must be greater than or equal to 1"));
    }
    properties = new ImmutableMap.Builder<String, String>().put("auto-vacuum.enabled", "true").put("auto-vacuum.scan.interval", "14s").put("auto-vacuum.scan.threads", "1").build();
    try {
        newInstance(expected.getClass(), properties);
    } catch (Exception e) {
        assertTrue(e.getMessage().contains("Invalid configuration property auto-vacuum.scan.interval"));
    }
}
Also used : AutoVacuumConfig(io.prestosql.vacuum.AutoVacuumConfig) ImmutableMap(com.google.common.collect.ImmutableMap) Test(org.testng.annotations.Test)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 AutoVacuumConfig (io.prestosql.vacuum.AutoVacuumConfig)1 Test (org.testng.annotations.Test)1