Search in sources :

Example 11 with CoordinatorDynamicConfig

use of org.apache.druid.server.coordinator.CoordinatorDynamicConfig in project druid by druid-io.

the class CoordinatorDynamicConfigTest method testBuilderWithDefaultSpecificDataSourcesToKillUnusedSegmentsInSpecified.

@Test
public void testBuilderWithDefaultSpecificDataSourcesToKillUnusedSegmentsInSpecified() {
    CoordinatorDynamicConfig defaultConfig = CoordinatorDynamicConfig.builder().withSpecificDataSourcesToKillUnusedSegmentsIn(ImmutableSet.of("DATASOURCE")).build();
    CoordinatorDynamicConfig config = CoordinatorDynamicConfig.builder().build(defaultConfig);
    assertConfig(config, 900000, 524288000, 100, 5, 100, 15, 10, 1, false, ImmutableSet.of("DATASOURCE"), false, EXPECTED_DEFAULT_MAX_SEGMENTS_IN_NODE_LOADING_QUEUE, ImmutableSet.of(), 70, false, false, Integer.MAX_VALUE);
}
Also used : CoordinatorDynamicConfig(org.apache.druid.server.coordinator.CoordinatorDynamicConfig) Test(org.junit.Test)

Example 12 with CoordinatorDynamicConfig

use of org.apache.druid.server.coordinator.CoordinatorDynamicConfig in project druid by druid-io.

the class CoordinatorDynamicConfigTest method testConstructorWithSpecificDataSourcesToKillShouldNotKillUnusedSegmentsInAllDatasources.

@Test
public void testConstructorWithSpecificDataSourcesToKillShouldNotKillUnusedSegmentsInAllDatasources() {
    CoordinatorDynamicConfig config = new CoordinatorDynamicConfig(1, 1, 1, 1, null, false, 1, 2, 10, true, ImmutableSet.of("test1"), null, null, ImmutableSet.of("host1"), 5, true, true, 10);
    Assert.assertFalse(config.isKillUnusedSegmentsInAllDataSources());
    Assert.assertEquals(ImmutableSet.of("test1"), config.getSpecificDataSourcesToKillUnusedSegmentsIn());
}
Also used : CoordinatorDynamicConfig(org.apache.druid.server.coordinator.CoordinatorDynamicConfig) Test(org.junit.Test)

Example 13 with CoordinatorDynamicConfig

use of org.apache.druid.server.coordinator.CoordinatorDynamicConfig in project druid by druid-io.

the class CoordinatorDynamicConfigTest method testDeserializeWithoutMaxSegmentsInNodeLoadingQueue.

@Test
public void testDeserializeWithoutMaxSegmentsInNodeLoadingQueue() throws Exception {
    String jsonStr = "{\n" + "  \"millisToWaitBeforeDeleting\": 1,\n" + "  \"mergeBytesLimit\": 1,\n" + "  \"mergeSegmentsLimit\" : 1,\n" + "  \"maxSegmentsToMove\": 1,\n" + "  \"percentOfSegmentsToConsiderPerMove\": 1,\n" + "  \"replicantLifetime\": 1,\n" + "  \"replicationThrottleLimit\": 1,\n" + "  \"balancerComputeThreads\": 2, \n" + "  \"emitBalancingStats\": true,\n" + "  \"killAllDataSources\": true\n" + "}\n";
    CoordinatorDynamicConfig actual = mapper.readValue(mapper.writeValueAsString(mapper.readValue(jsonStr, CoordinatorDynamicConfig.class)), CoordinatorDynamicConfig.class);
    assertConfig(actual, 1, 1, 1, 1, 1, 1, 1, 2, true, ImmutableSet.of(), true, EXPECTED_DEFAULT_MAX_SEGMENTS_IN_NODE_LOADING_QUEUE, ImmutableSet.of(), 0, false, false, Integer.MAX_VALUE);
}
Also used : CoordinatorDynamicConfig(org.apache.druid.server.coordinator.CoordinatorDynamicConfig) Test(org.junit.Test)

Example 14 with CoordinatorDynamicConfig

use of org.apache.druid.server.coordinator.CoordinatorDynamicConfig in project druid by druid-io.

the class CoordinatorDynamicConfigTest method testEqualsAndHashCodeSanity.

@Test
public void testEqualsAndHashCodeSanity() {
    CoordinatorDynamicConfig config1 = CoordinatorDynamicConfig.builder().build();
    CoordinatorDynamicConfig config2 = CoordinatorDynamicConfig.builder().build();
    Assert.assertEquals(config1, config2);
    Assert.assertEquals(config1.hashCode(), config2.hashCode());
}
Also used : CoordinatorDynamicConfig(org.apache.druid.server.coordinator.CoordinatorDynamicConfig) Test(org.junit.Test)

Aggregations

CoordinatorDynamicConfig (org.apache.druid.server.coordinator.CoordinatorDynamicConfig)14 Test (org.junit.Test)12 Consumes (javax.ws.rs.Consumes)1 POST (javax.ws.rs.POST)1 AuditInfo (org.apache.druid.audit.AuditInfo)1 SetResult (org.apache.druid.common.config.ConfigManager.SetResult)1 StatusResponseHolder (org.apache.druid.java.util.http.client.response.StatusResponseHolder)1