Search in sources :

Example 21 with TestDruidCoordinatorConfig

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

the class KillAuditLogTest method testConstructorFailIfInvalidRetainDuration.

@Test
public void testConstructorFailIfInvalidRetainDuration() {
    TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, new Duration("PT6S"), new Duration("PT-1S"), null, null, null, null, null, 10, null);
    exception.expect(IllegalArgumentException.class);
    exception.expectMessage("coordinator audit kill retainDuration must be >= 0");
    killAuditLog = new KillAuditLog(mockAuditManager, druidCoordinatorConfig);
}
Also used : TestDruidCoordinatorConfig(org.apache.druid.server.coordinator.TestDruidCoordinatorConfig) Duration(org.joda.time.Duration) Test(org.junit.Test)

Example 22 with TestDruidCoordinatorConfig

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

the class KillDatasourceMetadataTest method testRunWithEmptyFilterExcludedDatasource.

@Test
public void testRunWithEmptyFilterExcludedDatasource() {
    Mockito.when(mockDruidCoordinatorRuntimeParams.getEmitter()).thenReturn(mockServiceEmitter);
    TestDruidCoordinatorConfig druidCoordinatorConfig = new TestDruidCoordinatorConfig(null, null, null, new Duration("PT5S"), null, null, null, null, null, null, null, null, null, null, new Duration("PT6S"), new Duration("PT1S"), 10, null);
    killDatasourceMetadata = new KillDatasourceMetadata(druidCoordinatorConfig, mockIndexerMetadataStorageCoordinator, mockMetadataSupervisorManager);
    killDatasourceMetadata.run(mockDruidCoordinatorRuntimeParams);
    Mockito.verify(mockIndexerMetadataStorageCoordinator).removeDataSourceMetadataOlderThan(ArgumentMatchers.anyLong(), ArgumentMatchers.eq(ImmutableSet.of()));
    Mockito.verify(mockServiceEmitter).emit(ArgumentMatchers.any(ServiceEventBuilder.class));
}
Also used : ServiceEventBuilder(org.apache.druid.java.util.emitter.service.ServiceEventBuilder) TestDruidCoordinatorConfig(org.apache.druid.server.coordinator.TestDruidCoordinatorConfig) Duration(org.joda.time.Duration) Test(org.junit.Test)

Aggregations

TestDruidCoordinatorConfig (org.apache.druid.server.coordinator.TestDruidCoordinatorConfig)22 Duration (org.joda.time.Duration)22 Test (org.junit.Test)22 ServiceEventBuilder (org.apache.druid.java.util.emitter.service.ServiceEventBuilder)8 CoordinatorCompactionConfig (org.apache.druid.server.coordinator.CoordinatorCompactionConfig)3 DataSourceCompactionConfig (org.apache.druid.server.coordinator.DataSourceCompactionConfig)2 UserCompactionTaskGranularityConfig (org.apache.druid.server.coordinator.UserCompactionTaskGranularityConfig)2 Period (org.joda.time.Period)2 ExpectedException (org.junit.rules.ExpectedException)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 Answer (org.mockito.stubbing.Answer)1