Search in sources :

Example 6 with TestRemoteTaskRunnerConfig

use of io.druid.indexing.overlord.TestRemoteTaskRunnerConfig in project druid by druid-io.

the class JavaScriptWorkerSelectStrategyTest method testNoWorkerCanRunTask.

@Test
public void testNoWorkerCanRunTask() {
    ImmutableMap<String, ImmutableWorkerInfo> workerMap = ImmutableMap.of("10.0.0.1", createMockWorker(1, false, true), "10.0.0.4", createMockWorker(1, false, true));
    Optional<ImmutableWorkerInfo> workerForBatchTask = STRATEGY.findWorkerForTask(new TestRemoteTaskRunnerConfig(new Period("PT1S")), workerMap, createMockTask("index_hadoop"));
    Assert.assertFalse(workerForBatchTask.isPresent());
    Optional<ImmutableWorkerInfo> workerForOtherTask = STRATEGY.findWorkerForTask(new TestRemoteTaskRunnerConfig(new Period("PT1S")), workerMap, createMockTask("otherTask"));
    // all other tasks should be sent to worker2
    Assert.assertFalse(workerForOtherTask.isPresent());
}
Also used : TestRemoteTaskRunnerConfig(io.druid.indexing.overlord.TestRemoteTaskRunnerConfig) Period(org.joda.time.Period) ImmutableWorkerInfo(io.druid.indexing.overlord.ImmutableWorkerInfo) Test(org.junit.Test)

Aggregations

TestRemoteTaskRunnerConfig (io.druid.indexing.overlord.TestRemoteTaskRunnerConfig)6 Period (org.joda.time.Period)6 ImmutableWorkerInfo (io.druid.indexing.overlord.ImmutableWorkerInfo)5 Test (org.junit.Test)5 NamedType (com.fasterxml.jackson.databind.jsontype.NamedType)1 PotentiallyGzippedCompressionProvider (io.druid.curator.PotentiallyGzippedCompressionProvider)1 TestRealtimeTask (io.druid.indexing.common.TestRealtimeTask)1 IndexerZkConfig (io.druid.server.initialization.IndexerZkConfig)1 ZkPathsConfig (io.druid.server.initialization.ZkPathsConfig)1 ExponentialBackoffRetry (org.apache.curator.retry.ExponentialBackoffRetry)1 TestingCluster (org.apache.curator.test.TestingCluster)1 Before (org.junit.Before)1