use of io.druid.segment.loading.LocalDataSegmentKiller in project druid by druid-io.
the class TaskLifecycleTest method setUpTaskToolboxFactory.
private TaskToolboxFactory setUpTaskToolboxFactory(DataSegmentPusher dataSegmentPusher, SegmentHandoffNotifierFactory handoffNotifierFactory, TestIndexerMetadataStorageCoordinator mdc) throws IOException {
Preconditions.checkNotNull(queryRunnerFactoryConglomerate);
Preconditions.checkNotNull(monitorScheduler);
Preconditions.checkNotNull(taskStorage);
Preconditions.checkNotNull(emitter);
taskLockbox = new TaskLockbox(taskStorage);
tac = new LocalTaskActionClientFactory(taskStorage, new TaskActionToolbox(taskLockbox, mdc, emitter, EasyMock.createMock(SupervisorManager.class)));
File tmpDir = temporaryFolder.newFolder();
taskConfig = new TaskConfig(tmpDir.toString(), null, null, 50000, null, false, null, null);
return new TaskToolboxFactory(taskConfig, tac, emitter, dataSegmentPusher, new LocalDataSegmentKiller(new LocalDataSegmentPusherConfig()), new DataSegmentMover() {
@Override
public DataSegment move(DataSegment dataSegment, Map<String, Object> targetLoadSpec) throws SegmentLoadingException {
return dataSegment;
}
}, new DataSegmentArchiver() {
@Override
public DataSegment archive(DataSegment segment) throws SegmentLoadingException {
return segment;
}
@Override
public DataSegment restore(DataSegment segment) throws SegmentLoadingException {
return segment;
}
}, new DataSegmentAnnouncer() {
@Override
public void announceSegment(DataSegment segment) throws IOException {
announcedSinks++;
}
@Override
public void unannounceSegment(DataSegment segment) throws IOException {
}
@Override
public void announceSegments(Iterable<DataSegment> segments) throws IOException {
}
@Override
public void unannounceSegments(Iterable<DataSegment> segments) throws IOException {
}
@Override
public boolean isAnnounced(DataSegment segment) {
return false;
}
}, // segment announcer
handoffNotifierFactory, // query runner factory conglomerate corporation unionized collective
queryRunnerFactoryConglomerate, // query executor service
MoreExecutors.sameThreadExecutor(), // monitor scheduler
monitorScheduler, new SegmentLoaderFactory(new SegmentLoaderLocalCacheManager(null, new SegmentLoaderConfig() {
@Override
public List<StorageLocationConfig> getLocations() {
return Lists.newArrayList();
}
}, new DefaultObjectMapper())), MAPPER, INDEX_MERGER, INDEX_IO, MapCache.create(0), FireDepartmentTest.NO_CACHE_CONFIG, INDEX_MERGER_V9);
}
Aggregations