Search in sources :

Example 1 with FillCapacityWorkerSelectStrategy

use of org.apache.druid.indexing.overlord.setup.FillCapacityWorkerSelectStrategy in project druid by druid-io.

the class PendingTaskBasedProvisioningStrategyTest method setUp.

@Before
public void setUp() {
    autoScaler = EasyMock.createMock(AutoScaler.class);
    testTask = TestTasks.immediateSuccess("task1");
    config = new PendingTaskBasedWorkerProvisioningConfig().setMaxScalingDuration(new Period(1000)).setNumEventsToTrack(10).setPendingTaskTimeout(new Period(0)).setWorkerVersion(MIN_VERSION).setMaxScalingStep(2);
    workerConfig = new AtomicReference<>(new DefaultWorkerBehaviorConfig(new FillCapacityWorkerSelectStrategy(null), autoScaler));
    strategy = new PendingTaskBasedWorkerProvisioningStrategy(config, DSuppliers.of(workerConfig), new ProvisioningSchedulerConfig(), new Supplier<ScheduledExecutorService>() {

        @Override
        public ScheduledExecutorService get() {
            return executorService;
        }
    });
}
Also used : FillCapacityWorkerSelectStrategy(org.apache.druid.indexing.overlord.setup.FillCapacityWorkerSelectStrategy) DefaultWorkerBehaviorConfig(org.apache.druid.indexing.overlord.setup.DefaultWorkerBehaviorConfig) Period(org.joda.time.Period) Supplier(com.google.common.base.Supplier) Before(org.junit.Before)

Aggregations

Supplier (com.google.common.base.Supplier)1 DefaultWorkerBehaviorConfig (org.apache.druid.indexing.overlord.setup.DefaultWorkerBehaviorConfig)1 FillCapacityWorkerSelectStrategy (org.apache.druid.indexing.overlord.setup.FillCapacityWorkerSelectStrategy)1 Period (org.joda.time.Period)1 Before (org.junit.Before)1