use of org.apache.druid.indexing.overlord.config.RemoteTaskRunnerConfig in project druid by druid-io.
the class EqualDistributionWorkerSelectStrategyTest method testOneDisableWorkerDifferentUsedCapacity.
@Test
public void testOneDisableWorkerDifferentUsedCapacity() {
String disabledVersion = "";
final EqualDistributionWorkerSelectStrategy strategy = new EqualDistributionWorkerSelectStrategy(null);
ImmutableWorkerInfo worker = strategy.findWorkerForTask(new RemoteTaskRunnerConfig(), ImmutableMap.of("lhost", new ImmutableWorkerInfo(new Worker("http", "disableHost", "disableHost", 10, disabledVersion, WorkerConfig.DEFAULT_CATEGORY), 2, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc()), "localhost", new ImmutableWorkerInfo(new Worker("http", "enableHost", "enableHost", 10, "v1", WorkerConfig.DEFAULT_CATEGORY), 5, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc())), new NoopTask(null, null, null, 1, 0, null, null, null) {
@Override
public String getDataSource() {
return "foo";
}
});
Assert.assertEquals("enableHost", worker.getWorker().getHost());
}
use of org.apache.druid.indexing.overlord.config.RemoteTaskRunnerConfig in project druid by druid-io.
the class EqualDistributionWorkerSelectStrategyTest method testOneDisableWorkerSameUsedCapacity.
@Test
public void testOneDisableWorkerSameUsedCapacity() {
String disabledVersion = "";
final EqualDistributionWorkerSelectStrategy strategy = new EqualDistributionWorkerSelectStrategy(null);
ImmutableWorkerInfo worker = strategy.findWorkerForTask(new RemoteTaskRunnerConfig(), ImmutableMap.of("lhost", new ImmutableWorkerInfo(new Worker("http", "disableHost", "disableHost", 10, disabledVersion, WorkerConfig.DEFAULT_CATEGORY), 5, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc()), "localhost", new ImmutableWorkerInfo(new Worker("http", "enableHost", "enableHost", 10, "v1", WorkerConfig.DEFAULT_CATEGORY), 5, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc())), new NoopTask(null, null, null, 1, 0, null, null, null) {
@Override
public String getDataSource() {
return "foo";
}
});
Assert.assertEquals("enableHost", worker.getWorker().getHost());
}
use of org.apache.druid.indexing.overlord.config.RemoteTaskRunnerConfig in project druid by druid-io.
the class EqualDistributionWorkerSelectStrategyTest method testFindWorkerForTaskWhenSameCurrCapacityUsed.
@Test
public void testFindWorkerForTaskWhenSameCurrCapacityUsed() {
final EqualDistributionWorkerSelectStrategy strategy = new EqualDistributionWorkerSelectStrategy(null);
ImmutableWorkerInfo worker = strategy.findWorkerForTask(new RemoteTaskRunnerConfig(), ImmutableMap.of("lhost", new ImmutableWorkerInfo(new Worker("http", "lhost", "lhost", 5, "v1", WorkerConfig.DEFAULT_CATEGORY), 5, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc()), "localhost", new ImmutableWorkerInfo(new Worker("http", "localhost", "localhost", 10, "v1", WorkerConfig.DEFAULT_CATEGORY), 5, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc())), new NoopTask(null, null, null, 1, 0, null, null, null) {
@Override
public String getDataSource() {
return "foo";
}
});
Assert.assertEquals("localhost", worker.getWorker().getHost());
}
use of org.apache.druid.indexing.overlord.config.RemoteTaskRunnerConfig in project druid by druid-io.
the class EqualDistributionWorkerSelectStrategyTest method testFindWorkerForTask.
@Test
public void testFindWorkerForTask() {
final EqualDistributionWorkerSelectStrategy strategy = new EqualDistributionWorkerSelectStrategy(null);
ImmutableWorkerInfo worker = strategy.findWorkerForTask(new RemoteTaskRunnerConfig(), ImmutableMap.of("lhost", new ImmutableWorkerInfo(new Worker("http", "lhost", "lhost", 1, "v1", WorkerConfig.DEFAULT_CATEGORY), 0, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc()), "localhost", new ImmutableWorkerInfo(new Worker("http", "localhost", "localhost", 1, "v1", WorkerConfig.DEFAULT_CATEGORY), 1, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc())), new NoopTask(null, null, null, 1, 0, null, null, null) {
@Override
public String getDataSource() {
return "foo";
}
});
Assert.assertEquals("lhost", worker.getWorker().getHost());
}
use of org.apache.druid.indexing.overlord.config.RemoteTaskRunnerConfig in project druid by druid-io.
the class FillCapacityWithAffinityWorkerSelectStrategyTest method testFindWorkerForTask.
@Test
public void testFindWorkerForTask() {
FillCapacityWorkerSelectStrategy strategy = new FillCapacityWithAffinityWorkerSelectStrategy(new AffinityConfig(ImmutableMap.of("foo", ImmutableSet.of("localhost")), false));
ImmutableWorkerInfo worker = strategy.findWorkerForTask(new RemoteTaskRunnerConfig(), ImmutableMap.of("lhost", new ImmutableWorkerInfo(new Worker("http", "lhost", "lhost", 1, "v1", WorkerConfig.DEFAULT_CATEGORY), 0, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc()), "localhost", new ImmutableWorkerInfo(new Worker("http", "localhost", "localhost", 1, "v1", WorkerConfig.DEFAULT_CATEGORY), 0, new HashSet<>(), new HashSet<>(), DateTimes.nowUtc())), new NoopTask(null, null, null, 1, 0, null, null, null) {
@Override
public String getDataSource() {
return "foo";
}
});
Assert.assertEquals("localhost", worker.getWorker().getHost());
}
Aggregations