use of org.apache.druid.server.coordinator.TestDruidCoordinatorConfig in project druid by druid-io.
the class KillCompactionConfigTest method testConstructorFailIfInvalidPeriod.
@Test
public void testConstructorFailIfInvalidPeriod() {
TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, null, null, new Duration("PT3S"), null, null, null, null, 10, null);
exception.expect(IllegalArgumentException.class);
exception.expectMessage("Coordinator compaction configuration kill period must be >= druid.coordinator.period.metadataStoreManagementPeriod");
killCompactionConfig = new KillCompactionConfig(druidCoordinatorConfig, mockSqlSegmentsMetadataManager, mockJacksonConfigManager, mockConnector, mockConnectorConfig);
}
use of org.apache.druid.server.coordinator.TestDruidCoordinatorConfig in project druid by druid-io.
the class KillCompactionConfigTest method testRunSkipIfLastRunLessThanPeriod.
@Test
public void testRunSkipIfLastRunLessThanPeriod() {
TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, null, null, new Duration(Long.MAX_VALUE), null, null, null, null, 10, null);
killCompactionConfig = new KillCompactionConfig(druidCoordinatorConfig, mockSqlSegmentsMetadataManager, mockJacksonConfigManager, mockConnector, mockConnectorConfig);
killCompactionConfig.run(mockDruidCoordinatorRuntimeParams);
Mockito.verifyNoInteractions(mockSqlSegmentsMetadataManager);
Mockito.verifyNoInteractions(mockJacksonConfigManager);
Mockito.verifyNoInteractions(mockServiceEmitter);
}
use of org.apache.druid.server.coordinator.TestDruidCoordinatorConfig in project druid by druid-io.
the class KillRulesTest method testRunNotSkipIfLastRunMoreThanPeriod.
@Test
public void testRunNotSkipIfLastRunMoreThanPeriod() {
Mockito.when(mockDruidCoordinatorRuntimeParams.getEmitter()).thenReturn(mockServiceEmitter);
TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, null, null, null, new Duration("PT6S"), new Duration("PT1S"), null, null, 10, null);
killRules = new KillRules(druidCoordinatorConfig);
killRules.run(mockDruidCoordinatorRuntimeParams);
Mockito.verify(mockRuleManager).removeRulesForEmptyDatasourcesOlderThan(ArgumentMatchers.anyLong());
Mockito.verify(mockServiceEmitter).emit(ArgumentMatchers.any(ServiceEventBuilder.class));
}
use of org.apache.druid.server.coordinator.TestDruidCoordinatorConfig in project druid by druid-io.
the class KillRulesTest method testConstructorFailIfInvalidRetainDuration.
@Test
public void testConstructorFailIfInvalidRetainDuration() {
TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, null, null, null, new Duration("PT6S"), new Duration("PT-1S"), null, null, 10, null);
exception.expect(IllegalArgumentException.class);
exception.expectMessage("coordinator rule kill retainDuration must be >= 0");
killRules = new KillRules(druidCoordinatorConfig);
}
use of org.apache.druid.server.coordinator.TestDruidCoordinatorConfig in project druid by druid-io.
the class KillAuditLogTest method testRunNotSkipIfLastRunMoreThanPeriod.
@Test
public void testRunNotSkipIfLastRunMoreThanPeriod() {
Mockito.when(mockDruidCoordinatorRuntimeParams.getEmitter()).thenReturn(mockServiceEmitter);
TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, new Duration("PT6S"), new Duration("PT1S"), null, null, null, null, null, 10, null);
killAuditLog = new KillAuditLog(mockAuditManager, druidCoordinatorConfig);
killAuditLog.run(mockDruidCoordinatorRuntimeParams);
Mockito.verify(mockAuditManager).removeAuditLogsOlderThan(ArgumentMatchers.anyLong());
Mockito.verify(mockServiceEmitter).emit(ArgumentMatchers.any(ServiceEventBuilder.class));
}
Aggregations