|
@@ -45,6 +45,7 @@ import org.elasticsearch.gateway.GatewayAllocator;
|
|
|
import org.elasticsearch.indices.EmptySystemIndices;
|
|
|
import org.elasticsearch.plugins.ClusterPlugin;
|
|
|
import org.elasticsearch.tasks.TaskManager;
|
|
|
+import org.elasticsearch.telemetry.TelemetryProvider;
|
|
|
import org.elasticsearch.test.gateway.TestGatewayAllocator;
|
|
|
import org.elasticsearch.threadpool.TestThreadPool;
|
|
|
import org.elasticsearch.threadpool.ThreadPool;
|
|
@@ -155,7 +156,7 @@ public class ClusterModuleTests extends ModuleTestCase {
|
|
|
public Collection<AllocationDecider> createAllocationDeciders(Settings settings, ClusterSettings clusterSettings) {
|
|
|
return Collections.singletonList(new EnableAllocationDecider(clusterSettings));
|
|
|
}
|
|
|
- }), clusterInfoService, null, threadPool, EmptySystemIndices.INSTANCE, WriteLoadForecaster.DEFAULT)
|
|
|
+ }), clusterInfoService, null, threadPool, EmptySystemIndices.INSTANCE, WriteLoadForecaster.DEFAULT, TelemetryProvider.NOOP)
|
|
|
);
|
|
|
assertEquals(e.getMessage(), "Cannot specify allocation decider [" + EnableAllocationDecider.class.getName() + "] twice");
|
|
|
}
|
|
@@ -166,7 +167,7 @@ public class ClusterModuleTests extends ModuleTestCase {
|
|
|
public Collection<AllocationDecider> createAllocationDeciders(Settings settings, ClusterSettings clusterSettings) {
|
|
|
return Collections.singletonList(new FakeAllocationDecider());
|
|
|
}
|
|
|
- }), clusterInfoService, null, threadPool, EmptySystemIndices.INSTANCE, WriteLoadForecaster.DEFAULT);
|
|
|
+ }), clusterInfoService, null, threadPool, EmptySystemIndices.INSTANCE, WriteLoadForecaster.DEFAULT, TelemetryProvider.NOOP);
|
|
|
assertTrue(module.deciderList.stream().anyMatch(d -> d.getClass().equals(FakeAllocationDecider.class)));
|
|
|
}
|
|
|
|
|
@@ -176,7 +177,7 @@ public class ClusterModuleTests extends ModuleTestCase {
|
|
|
public Map<String, Supplier<ShardsAllocator>> getShardsAllocators(Settings settings, ClusterSettings clusterSettings) {
|
|
|
return Collections.singletonMap(name, supplier);
|
|
|
}
|
|
|
- }), clusterInfoService, null, threadPool, EmptySystemIndices.INSTANCE, WriteLoadForecaster.DEFAULT);
|
|
|
+ }), clusterInfoService, null, threadPool, EmptySystemIndices.INSTANCE, WriteLoadForecaster.DEFAULT, TelemetryProvider.NOOP);
|
|
|
}
|
|
|
|
|
|
public void testRegisterShardsAllocator() {
|
|
@@ -208,7 +209,8 @@ public class ClusterModuleTests extends ModuleTestCase {
|
|
|
null,
|
|
|
threadPool,
|
|
|
EmptySystemIndices.INSTANCE,
|
|
|
- WriteLoadForecaster.DEFAULT
|
|
|
+ WriteLoadForecaster.DEFAULT,
|
|
|
+ TelemetryProvider.NOOP
|
|
|
)
|
|
|
);
|
|
|
assertEquals("Unknown ShardsAllocator [dne]", e.getMessage());
|
|
@@ -272,7 +274,8 @@ public class ClusterModuleTests extends ModuleTestCase {
|
|
|
null,
|
|
|
threadPool,
|
|
|
EmptySystemIndices.INSTANCE,
|
|
|
- WriteLoadForecaster.DEFAULT
|
|
|
+ WriteLoadForecaster.DEFAULT,
|
|
|
+ TelemetryProvider.NOOP
|
|
|
);
|
|
|
expectThrows(IllegalArgumentException.class, () -> clusterModule.setExistingShardsAllocators(new TestGatewayAllocator()));
|
|
|
}
|
|
@@ -286,7 +289,8 @@ public class ClusterModuleTests extends ModuleTestCase {
|
|
|
null,
|
|
|
threadPool,
|
|
|
EmptySystemIndices.INSTANCE,
|
|
|
- WriteLoadForecaster.DEFAULT
|
|
|
+ WriteLoadForecaster.DEFAULT,
|
|
|
+ TelemetryProvider.NOOP
|
|
|
);
|
|
|
expectThrows(IllegalArgumentException.class, () -> clusterModule.setExistingShardsAllocators(new TestGatewayAllocator()));
|
|
|
}
|