Search in sources :

Example 1 with LocalDataSegmentKiller

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);
}
Also used : DataSegmentAnnouncer(io.druid.server.coordination.DataSegmentAnnouncer) DataSegmentArchiver(io.druid.segment.loading.DataSegmentArchiver) DataSegmentMover(io.druid.segment.loading.DataSegmentMover) TaskConfig(io.druid.indexing.common.config.TaskConfig) DataSegment(io.druid.timeline.DataSegment) TaskToolboxFactory(io.druid.indexing.common.TaskToolboxFactory) TaskActionToolbox(io.druid.indexing.common.actions.TaskActionToolbox) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) LocalTaskActionClientFactory(io.druid.indexing.common.actions.LocalTaskActionClientFactory) SegmentLoaderConfig(io.druid.segment.loading.SegmentLoaderConfig) SegmentLoaderFactory(io.druid.indexing.common.SegmentLoaderFactory) SegmentLoaderLocalCacheManager(io.druid.segment.loading.SegmentLoaderLocalCacheManager) SegmentLoadingException(io.druid.segment.loading.SegmentLoadingException) LocalDataSegmentPusherConfig(io.druid.segment.loading.LocalDataSegmentPusherConfig) IOException(java.io.IOException) SupervisorManager(io.druid.indexing.overlord.supervisor.SupervisorManager) LocalDataSegmentKiller(io.druid.segment.loading.LocalDataSegmentKiller) DefaultObjectMapper(io.druid.jackson.DefaultObjectMapper) File(java.io.File)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 SegmentLoaderFactory (io.druid.indexing.common.SegmentLoaderFactory)1 TaskToolboxFactory (io.druid.indexing.common.TaskToolboxFactory)1 LocalTaskActionClientFactory (io.druid.indexing.common.actions.LocalTaskActionClientFactory)1 TaskActionToolbox (io.druid.indexing.common.actions.TaskActionToolbox)1 TaskConfig (io.druid.indexing.common.config.TaskConfig)1 SupervisorManager (io.druid.indexing.overlord.supervisor.SupervisorManager)1 DefaultObjectMapper (io.druid.jackson.DefaultObjectMapper)1 DataSegmentArchiver (io.druid.segment.loading.DataSegmentArchiver)1 DataSegmentMover (io.druid.segment.loading.DataSegmentMover)1 LocalDataSegmentKiller (io.druid.segment.loading.LocalDataSegmentKiller)1 LocalDataSegmentPusherConfig (io.druid.segment.loading.LocalDataSegmentPusherConfig)1 SegmentLoaderConfig (io.druid.segment.loading.SegmentLoaderConfig)1 SegmentLoaderLocalCacheManager (io.druid.segment.loading.SegmentLoaderLocalCacheManager)1 SegmentLoadingException (io.druid.segment.loading.SegmentLoadingException)1 DataSegmentAnnouncer (io.druid.server.coordination.DataSegmentAnnouncer)1 DataSegment (io.druid.timeline.DataSegment)1 File (java.io.File)1 IOException (java.io.IOException)1 List (java.util.List)1