Search in sources :

Example 11 with NoopIndexingServiceClient

use of org.apache.druid.client.indexing.NoopIndexingServiceClient in project druid by druid-io.

the class ShuffleResourceTest method setup.

@Before
public void setup() throws IOException {
    final WorkerConfig workerConfig = new WorkerConfig() {

        @Override
        public long getIntermediaryPartitionDiscoveryPeriodSec() {
            return 1;
        }

        @Override
        public long getIntermediaryPartitionCleanupPeriodSec() {
            return 2;
        }

        @Override
        public Period getIntermediaryPartitionTimeout() {
            return new Period("PT2S");
        }
    };
    final TaskConfig taskConfig = new TaskConfig(null, null, null, null, null, false, null, null, ImmutableList.of(new StorageLocationConfig(tempDir.newFolder(), null, null)), false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name());
    final IndexingServiceClient indexingServiceClient = new NoopIndexingServiceClient() {

        @Override
        public Map<String, TaskStatus> getTaskStatuses(Set<String> taskIds) {
            final Map<String, TaskStatus> result = new HashMap<>();
            for (String taskId : taskIds) {
                result.put(taskId, new TaskStatus(taskId, TaskState.SUCCESS, 10));
            }
            return result;
        }
    };
    intermediaryDataManager = new LocalIntermediaryDataManager(workerConfig, taskConfig, indexingServiceClient);
    shuffleMetrics = new ShuffleMetrics();
    shuffleResource = new ShuffleResource(intermediaryDataManager, Optional.of(shuffleMetrics));
}
Also used : IndexingServiceClient(org.apache.druid.client.indexing.IndexingServiceClient) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) Set(java.util.Set) HashMap(java.util.HashMap) Period(org.joda.time.Period) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) TaskStatus(org.apache.druid.client.indexing.TaskStatus) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) PerDatasourceShuffleMetrics(org.apache.druid.indexing.worker.shuffle.ShuffleMetrics.PerDatasourceShuffleMetrics) WorkerConfig(org.apache.druid.indexing.worker.config.WorkerConfig) Before(org.junit.Before)

Example 12 with NoopIndexingServiceClient

use of org.apache.druid.client.indexing.NoopIndexingServiceClient in project druid by druid-io.

the class WorkerTaskManagerTest method createWorkerTaskManager.

private WorkerTaskManager createWorkerTaskManager() {
    TaskConfig taskConfig = new TaskConfig(FileUtils.createTempDir().toString(), null, null, 0, null, false, null, null, null, false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name());
    TaskActionClientFactory taskActionClientFactory = EasyMock.createNiceMock(TaskActionClientFactory.class);
    TaskActionClient taskActionClient = EasyMock.createNiceMock(TaskActionClient.class);
    EasyMock.expect(taskActionClientFactory.create(EasyMock.anyObject())).andReturn(taskActionClient).anyTimes();
    SegmentHandoffNotifierFactory notifierFactory = EasyMock.createNiceMock(SegmentHandoffNotifierFactory.class);
    EasyMock.replay(taskActionClientFactory, taskActionClient, notifierFactory);
    return new WorkerTaskManager(jsonMapper, new TestTaskRunner(new TaskToolboxFactory(taskConfig, null, taskActionClientFactory, null, null, null, null, null, null, null, notifierFactory, null, null, NoopJoinableFactory.INSTANCE, null, new SegmentCacheManagerFactory(jsonMapper), jsonMapper, indexIO, null, null, null, indexMergerV9, null, null, null, null, new NoopTestTaskReportFileWriter(), null, AuthTestUtils.TEST_AUTHORIZER_MAPPER, new NoopChatHandlerProvider(), testUtils.getRowIngestionMetersFactory(), new TestAppenderatorsManager(), new NoopIndexingServiceClient(), null, null, null), taskConfig, location), taskConfig, EasyMock.createNiceMock(DruidLeaderClient.class)) {

        @Override
        protected void taskStarted(String taskId) {
        }

        @Override
        protected void taskAnnouncementChanged(TaskAnnouncement announcement) {
        }
    };
}
Also used : NoopChatHandlerProvider(org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider) TestTaskRunner(org.apache.druid.indexing.overlord.TestTaskRunner) SegmentCacheManagerFactory(org.apache.druid.indexing.common.SegmentCacheManagerFactory) TaskActionClientFactory(org.apache.druid.indexing.common.actions.TaskActionClientFactory) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) DruidLeaderClient(org.apache.druid.discovery.DruidLeaderClient) SegmentHandoffNotifierFactory(org.apache.druid.segment.handoff.SegmentHandoffNotifierFactory) TaskActionClient(org.apache.druid.indexing.common.actions.TaskActionClient) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) TaskToolboxFactory(org.apache.druid.indexing.common.TaskToolboxFactory) NoopTestTaskReportFileWriter(org.apache.druid.indexing.common.task.NoopTestTaskReportFileWriter) TestAppenderatorsManager(org.apache.druid.indexing.common.task.TestAppenderatorsManager)

Example 13 with NoopIndexingServiceClient

use of org.apache.druid.client.indexing.NoopIndexingServiceClient in project druid by druid-io.

the class LocalIntermediaryDataManagerManualAddAndDeleteTest method setup.

@Before
public void setup() throws IOException {
    final WorkerConfig workerConfig = new WorkerConfig();
    intermediarySegmentsLocation = tempDir.newFolder();
    siblingLocation = tempDir.newFolder();
    final TaskConfig taskConfig = new TaskConfig(null, null, null, null, null, false, null, null, ImmutableList.of(new StorageLocationConfig(intermediarySegmentsLocation, 1200L, null)), false, false, TaskConfig.BATCH_PROCESSING_MODE_DEFAULT.name());
    final IndexingServiceClient indexingServiceClient = new NoopIndexingServiceClient();
    intermediaryDataManager = new LocalIntermediaryDataManager(workerConfig, taskConfig, indexingServiceClient);
    intermediaryDataManager.start();
}
Also used : IndexingServiceClient(org.apache.druid.client.indexing.IndexingServiceClient) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) StorageLocationConfig(org.apache.druid.segment.loading.StorageLocationConfig) NoopIndexingServiceClient(org.apache.druid.client.indexing.NoopIndexingServiceClient) WorkerConfig(org.apache.druid.indexing.worker.config.WorkerConfig) TaskConfig(org.apache.druid.indexing.common.config.TaskConfig) Before(org.junit.Before)

Aggregations

NoopIndexingServiceClient (org.apache.druid.client.indexing.NoopIndexingServiceClient)13 TaskConfig (org.apache.druid.indexing.common.config.TaskConfig)12 SegmentCacheManagerFactory (org.apache.druid.indexing.common.SegmentCacheManagerFactory)9 NoopChatHandlerProvider (org.apache.druid.segment.realtime.firehose.NoopChatHandlerProvider)9 TaskToolboxFactory (org.apache.druid.indexing.common.TaskToolboxFactory)8 TaskActionClientFactory (org.apache.druid.indexing.common.actions.TaskActionClientFactory)7 File (java.io.File)6 SegmentHandoffNotifierFactory (org.apache.druid.segment.handoff.SegmentHandoffNotifierFactory)6 DruidNode (org.apache.druid.server.DruidNode)6 Before (org.junit.Before)6 Set (java.util.Set)5 CachePopulatorStats (org.apache.druid.client.cache.CachePopulatorStats)5 IndexingServiceClient (org.apache.druid.client.indexing.IndexingServiceClient)5 DataNodeService (org.apache.druid.discovery.DataNodeService)5 DruidNodeAnnouncer (org.apache.druid.discovery.DruidNodeAnnouncer)5 LookupNodeService (org.apache.druid.discovery.LookupNodeService)5 LocalTaskActionClientFactory (org.apache.druid.indexing.common.actions.LocalTaskActionClientFactory)5 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 ImmutableList (com.google.common.collect.ImmutableList)4 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)4