Search in sources :

Example 1 with TestDruidCoordinatorConfig

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

the class DruidCoordinatorSegmentKillerTest method testFindIntervalForKillTask.

private void testFindIntervalForKillTask(List<Interval> segmentManagerResult, Interval expected) {
    MetadataSegmentManager segmentManager = EasyMock.createMock(MetadataSegmentManager.class);
    EasyMock.expect(segmentManager.getUnusedSegmentIntervals(EasyMock.anyString(), EasyMock.anyObject(Interval.class), EasyMock.anyInt())).andReturn(segmentManagerResult);
    EasyMock.replay(segmentManager);
    IndexingServiceClient indexingServiceClient = EasyMock.createMock(IndexingServiceClient.class);
    DruidCoordinatorSegmentKiller coordinatorSegmentKiller = new DruidCoordinatorSegmentKiller(segmentManager, indexingServiceClient, new TestDruidCoordinatorConfig(null, null, Duration.parse("PT76400S"), new Duration(1), Duration.parse("PT86400S"), Duration.parse("PT86400S"), 1000, null, false, false, Duration.ZERO));
    Assert.assertEquals(expected, coordinatorSegmentKiller.findIntervalForKillTask("test", 10000));
}
Also used : IndexingServiceClient(io.druid.client.indexing.IndexingServiceClient) MetadataSegmentManager(io.druid.metadata.MetadataSegmentManager) TestDruidCoordinatorConfig(io.druid.server.coordinator.TestDruidCoordinatorConfig) Duration(org.joda.time.Duration) Interval(org.joda.time.Interval)

Aggregations

IndexingServiceClient (io.druid.client.indexing.IndexingServiceClient)1 MetadataSegmentManager (io.druid.metadata.MetadataSegmentManager)1 TestDruidCoordinatorConfig (io.druid.server.coordinator.TestDruidCoordinatorConfig)1 Duration (org.joda.time.Duration)1 Interval (org.joda.time.Interval)1