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);
}
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());
}
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);
}
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());
}
Aggregations