diff --git a/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/cloud/azure/classic/management/AzureComputeServiceImpl.java b/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/cloud/azure/classic/management/AzureComputeServiceImpl.java index 710dfa7e71df7..b8e885b947006 100644 --- a/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/cloud/azure/classic/management/AzureComputeServiceImpl.java +++ b/plugins/discovery-azure-classic/src/main/java/org/elasticsearch/cloud/azure/classic/management/AzureComputeServiceImpl.java @@ -52,7 +52,6 @@ public class AzureComputeServiceImpl extends AbstractLifecycleComponent private final String serviceName; public AzureComputeServiceImpl(Settings settings) { - super(settings); String subscriptionId = getRequiredSetting(settings, Management.SUBSCRIPTION_ID_SETTING); serviceName = getRequiredSetting(settings, Management.SERVICE_NAME_SETTING); diff --git a/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceMetadataService.java b/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceMetadataService.java index 248d9a0447915..1fae7e63854c1 100644 --- a/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceMetadataService.java +++ b/plugins/discovery-gce/src/main/java/org/elasticsearch/cloud/gce/GceMetadataService.java @@ -53,7 +53,6 @@ public class GceMetadataService extends AbstractLifecycleComponent { private HttpTransport gceHttpTransport; public GceMetadataService(Settings settings) { - super(settings); this.settings = settings; } diff --git a/server/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java b/server/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java index 8010765854016..90526aaa9fd21 100644 --- a/server/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java +++ b/server/src/main/java/org/elasticsearch/cluster/NodeConnectionsService.java @@ -75,7 +75,6 @@ public class NodeConnectionsService extends AbstractLifecycleComponent { @Inject public NodeConnectionsService(Settings settings, ThreadPool threadPool, TransportService transportService) { - super(settings); this.threadPool = threadPool; this.transportService = transportService; this.reconnectInterval = NodeConnectionsService.CLUSTER_NODE_RECONNECT_INTERVAL_SETTING.get(settings); diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/DelayedAllocationService.java b/server/src/main/java/org/elasticsearch/cluster/routing/DelayedAllocationService.java index 2f593082fa9e3..77246f7d7ca65 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/DelayedAllocationService.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/DelayedAllocationService.java @@ -30,7 +30,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.FutureUtils; @@ -130,9 +129,8 @@ public void onFailure(String source, Exception e) { } @Inject - public DelayedAllocationService(Settings settings, ThreadPool threadPool, ClusterService clusterService, + public DelayedAllocationService(ThreadPool threadPool, ClusterService clusterService, AllocationService allocationService) { - super(settings); this.threadPool = threadPool; this.clusterService = clusterService; this.allocationService = allocationService; diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java index 5d711cabce763..57f7a313942bb 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/RoutingService.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.Priority; import org.elasticsearch.common.component.AbstractLifecycleComponent; import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.settings.Settings; import java.util.concurrent.atomic.AtomicBoolean; @@ -57,8 +56,7 @@ public class RoutingService extends AbstractLifecycleComponent { private AtomicBoolean rerouting = new AtomicBoolean(); @Inject - public RoutingService(Settings settings, ClusterService clusterService, AllocationService allocationService) { - super(settings); + public RoutingService(ClusterService clusterService, AllocationService allocationService) { this.clusterService = clusterService; this.allocationService = allocationService; } diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java index 125d381652b62..3ccbe5ebb7495 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java @@ -104,7 +104,6 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements public ClusterApplierService(String nodeName, Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool, Supplier stateBuilderSupplier) { - super(settings); this.clusterSettings = clusterSettings; this.threadPool = threadPool; this.state = new AtomicReference<>(); diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java index abaf57d2eba32..a891e657512a5 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java @@ -76,7 +76,6 @@ public class ClusterService extends AbstractLifecycleComponent { public ClusterService(Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool, Map> initialClusterStateCustoms) { - super(settings); this.settings = settings; this.nodeName = Node.NODE_NAME_SETTING.get(settings); this.masterService = new MasterService(nodeName, settings, threadPool); diff --git a/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java b/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java index d86cf7f7683e3..b81d32e9d81e5 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/MasterService.java @@ -85,7 +85,6 @@ public class MasterService extends AbstractLifecycleComponent { private volatile Batcher taskBatcher; public MasterService(String nodeName, Settings settings, ThreadPool threadPool) { - super(settings); this.nodeName = nodeName; // TODO: introduce a dedicated setting for master service this.slowTaskLoggingThreshold = CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings); diff --git a/server/src/main/java/org/elasticsearch/common/component/AbstractLifecycleComponent.java b/server/src/main/java/org/elasticsearch/common/component/AbstractLifecycleComponent.java index 8a3f8d0cff6f7..6e4cc95489778 100644 --- a/server/src/main/java/org/elasticsearch/common/component/AbstractLifecycleComponent.java +++ b/server/src/main/java/org/elasticsearch/common/component/AbstractLifecycleComponent.java @@ -34,6 +34,13 @@ public abstract class AbstractLifecycleComponent implements LifecycleComponent { private final List listeners = new CopyOnWriteArrayList<>(); + protected AbstractLifecycleComponent() {} + + /** + * @deprecated the settings parameters are not used, therefore the use of this constructor is deprecated. + * Going to be removed in subsequent versions. The parameterless constructor should be used instead. + */ + @Deprecated protected AbstractLifecycleComponent(Settings settings) { // TODO drop settings from ctor } diff --git a/server/src/main/java/org/elasticsearch/discovery/single/SingleNodeDiscovery.java b/server/src/main/java/org/elasticsearch/discovery/single/SingleNodeDiscovery.java index 189ce336c9598..ea4ebf987faad 100644 --- a/server/src/main/java/org/elasticsearch/discovery/single/SingleNodeDiscovery.java +++ b/server/src/main/java/org/elasticsearch/discovery/single/SingleNodeDiscovery.java @@ -57,7 +57,7 @@ public class SingleNodeDiscovery extends AbstractLifecycleComponent implements D public SingleNodeDiscovery(final Settings settings, final TransportService transportService, final MasterService masterService, final ClusterApplier clusterApplier) { - super(Objects.requireNonNull(settings)); + Objects.requireNonNull(settings); this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings); this.transportService = Objects.requireNonNull(transportService); masterService.setClusterStateSupplier(() -> clusterState); diff --git a/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java b/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java index d63496a573603..c42bfd0670ca8 100644 --- a/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java +++ b/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java @@ -159,7 +159,6 @@ public ZenDiscovery(Settings settings, ThreadPool threadPool, TransportService t NamedWriteableRegistry namedWriteableRegistry, MasterService masterService, ClusterApplier clusterApplier, ClusterSettings clusterSettings, UnicastHostsProvider hostsProvider, AllocationService allocationService, Collection> onJoinValidators) { - super(settings); this.onJoinValidators = addBuiltInJoinValidators(onJoinValidators); this.masterService = masterService; this.clusterApplier = clusterApplier; diff --git a/server/src/main/java/org/elasticsearch/gateway/GatewayService.java b/server/src/main/java/org/elasticsearch/gateway/GatewayService.java index 004b71b9d9703..e94751e6f0cd9 100644 --- a/server/src/main/java/org/elasticsearch/gateway/GatewayService.java +++ b/server/src/main/java/org/elasticsearch/gateway/GatewayService.java @@ -97,7 +97,6 @@ public GatewayService(Settings settings, AllocationService allocationService, Cl ThreadPool threadPool, GatewayMetaState metaState, TransportNodesListGatewayMetaState listGatewayMetaState, IndicesService indicesService) { - super(settings); this.gateway = new Gateway(settings, clusterService, listGatewayMetaState, indicesService); this.allocationService = allocationService; diff --git a/server/src/main/java/org/elasticsearch/indices/IndicesService.java b/server/src/main/java/org/elasticsearch/indices/IndicesService.java index 07a80172f3864..38171acb9cab3 100644 --- a/server/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/server/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -220,7 +220,6 @@ public IndicesService(Settings settings, PluginsService pluginsService, NodeEnvi ScriptService scriptService, Client client, MetaStateService metaStateService, Collection>> engineFactoryProviders, Map> indexStoreFactories) { - super(settings); this.settings = settings; this.threadPool = threadPool; this.pluginsService = pluginsService; diff --git a/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerService.java b/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerService.java index cc6b7d5ef85bc..90a814b29b3c5 100644 --- a/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerService.java +++ b/server/src/main/java/org/elasticsearch/indices/breaker/CircuitBreakerService.java @@ -23,7 +23,6 @@ import org.apache.logging.log4j.Logger; import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.component.AbstractLifecycleComponent; -import org.elasticsearch.common.settings.Settings; /** * Interface for Circuit Breaker services, which provide breakers to classes @@ -32,8 +31,7 @@ public abstract class CircuitBreakerService extends AbstractLifecycleComponent { private static final Logger logger = LogManager.getLogger(CircuitBreakerService.class); - protected CircuitBreakerService(Settings settings) { - super(settings); + protected CircuitBreakerService() { } /** diff --git a/server/src/main/java/org/elasticsearch/indices/breaker/HierarchyCircuitBreakerService.java b/server/src/main/java/org/elasticsearch/indices/breaker/HierarchyCircuitBreakerService.java index 784168fba9e30..0ea5df12bd16d 100644 --- a/server/src/main/java/org/elasticsearch/indices/breaker/HierarchyCircuitBreakerService.java +++ b/server/src/main/java/org/elasticsearch/indices/breaker/HierarchyCircuitBreakerService.java @@ -90,7 +90,7 @@ public class HierarchyCircuitBreakerService extends CircuitBreakerService { private final AtomicLong parentTripCount = new AtomicLong(0); public HierarchyCircuitBreakerService(Settings settings, ClusterSettings clusterSettings) { - super(settings); + super(); this.fielddataSettings = new BreakerSettings(CircuitBreaker.FIELDDATA, FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(), FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings), diff --git a/server/src/main/java/org/elasticsearch/indices/breaker/NoneCircuitBreakerService.java b/server/src/main/java/org/elasticsearch/indices/breaker/NoneCircuitBreakerService.java index c686412bc29b2..69de18e380b63 100644 --- a/server/src/main/java/org/elasticsearch/indices/breaker/NoneCircuitBreakerService.java +++ b/server/src/main/java/org/elasticsearch/indices/breaker/NoneCircuitBreakerService.java @@ -21,7 +21,6 @@ import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.breaker.NoopCircuitBreaker; -import org.elasticsearch.common.settings.Settings; /** * Class that returns a breaker that never breaks @@ -31,7 +30,7 @@ public class NoneCircuitBreakerService extends CircuitBreakerService { private final CircuitBreaker breaker = new NoopCircuitBreaker(CircuitBreaker.FIELDDATA); public NoneCircuitBreakerService() { - super(Settings.EMPTY); + super(); } @Override diff --git a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java index 41050d7d47486..c8afe92be8d37 100644 --- a/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java @@ -171,7 +171,6 @@ public IndicesClusterStateService( final SnapshotShardsService snapshotShardsService, final PrimaryReplicaSyncer primaryReplicaSyncer, final Consumer globalCheckpointSyncer) { - super(settings); this.settings = settings; this.buildInIndexListener = Arrays.asList( diff --git a/server/src/main/java/org/elasticsearch/monitor/MonitorService.java b/server/src/main/java/org/elasticsearch/monitor/MonitorService.java index 9467bf29923d8..df91487332435 100644 --- a/server/src/main/java/org/elasticsearch/monitor/MonitorService.java +++ b/server/src/main/java/org/elasticsearch/monitor/MonitorService.java @@ -42,7 +42,6 @@ public class MonitorService extends AbstractLifecycleComponent { public MonitorService(Settings settings, NodeEnvironment nodeEnvironment, ThreadPool threadPool, ClusterInfoService clusterInfoService) throws IOException { - super(settings); this.jvmGcMonitorService = new JvmGcMonitorService(settings, threadPool); this.osService = new OsService(settings); this.processService = new ProcessService(settings); diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmGcMonitorService.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmGcMonitorService.java index 94c66c79d2ee7..70de50710c999 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmGcMonitorService.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmGcMonitorService.java @@ -107,7 +107,6 @@ public String toString() { } public JvmGcMonitorService(Settings settings, ThreadPool threadPool) { - super(settings); this.threadPool = threadPool; this.enabled = ENABLED_SETTING.get(settings); diff --git a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java index 5ea17d0bf517d..93bbafd61bce7 100644 --- a/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/elasticsearch/repositories/blobstore/BlobStoreRepository.java @@ -243,7 +243,6 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp * @param settings Settings for the node this repository object is created on */ protected BlobStoreRepository(RepositoryMetaData metadata, Settings settings, NamedXContentRegistry namedXContentRegistry) { - super(settings); this.settings = settings; this.metadata = metadata; this.namedXContentRegistry = namedXContentRegistry; diff --git a/server/src/main/java/org/elasticsearch/search/SearchService.java b/server/src/main/java/org/elasticsearch/search/SearchService.java index 9fc749ca07ac0..3ab456561aa70 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchService.java +++ b/server/src/main/java/org/elasticsearch/search/SearchService.java @@ -196,7 +196,6 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv public SearchService(ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase, ResponseCollectorService responseCollectorService) { - super(clusterService.getSettings()); Settings settings = clusterService.getSettings(); this.threadPool = threadPool; this.clusterService = clusterService; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java index 46d89b2178851..3f1cf1db32807 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java @@ -127,7 +127,6 @@ public class SnapshotShardsService extends AbstractLifecycleComponent implements public SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) { - super(settings); this.settings = settings; this.indicesService = indicesService; this.snapshotsService = snapshotsService; diff --git a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java index 4521213b76d86..3054899ced47d 100644 --- a/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java @@ -124,7 +124,6 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus @Inject public SnapshotsService(Settings settings, ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver, RepositoriesService repositoriesService, ThreadPool threadPool) { - super(settings); this.clusterService = clusterService; this.indexNameExpressionResolver = indexNameExpressionResolver; this.repositoriesService = repositoriesService; diff --git a/server/src/main/java/org/elasticsearch/transport/TcpTransport.java b/server/src/main/java/org/elasticsearch/transport/TcpTransport.java index a10bad9e88b69..dd6a21acc8fbd 100644 --- a/server/src/main/java/org/elasticsearch/transport/TcpTransport.java +++ b/server/src/main/java/org/elasticsearch/transport/TcpTransport.java @@ -156,7 +156,6 @@ public abstract class TcpTransport extends AbstractLifecycleComponent implements public TcpTransport(String transportName, Settings settings, Version version, ThreadPool threadPool, PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry, NetworkService networkService) { - super(settings); this.settings = settings; this.profileSettings = getProfileSettings(settings); this.version = version; diff --git a/server/src/main/java/org/elasticsearch/transport/TransportService.java b/server/src/main/java/org/elasticsearch/transport/TransportService.java index 80b0a39d30327..676575b8ecd49 100644 --- a/server/src/main/java/org/elasticsearch/transport/TransportService.java +++ b/server/src/main/java/org/elasticsearch/transport/TransportService.java @@ -155,7 +155,6 @@ public TransportService(Settings settings, Transport transport, ThreadPool threa public TransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor transportInterceptor, Function localNodeFactory, @Nullable ClusterSettings clusterSettings, Set taskHeaders, ConnectionManager connectionManager) { - super(settings); // The only time we do not want to validate node connections is when this is a transport client using the simple node sampler this.validateConnections = TransportClient.CLIENT_TYPE.equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey())) == false || TransportClient.CLIENT_TRANSPORT_SNIFF.get(settings); diff --git a/server/src/main/java/org/elasticsearch/watcher/ResourceWatcherService.java b/server/src/main/java/org/elasticsearch/watcher/ResourceWatcherService.java index 3edab68e1580f..4216bd817b68c 100644 --- a/server/src/main/java/org/elasticsearch/watcher/ResourceWatcherService.java +++ b/server/src/main/java/org/elasticsearch/watcher/ResourceWatcherService.java @@ -90,7 +90,6 @@ public enum Frequency { @Inject public ResourceWatcherService(Settings settings, ThreadPool threadPool) { - super(settings); this.enabled = ENABLED.get(settings); this.threadPool = threadPool; diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/DelayedAllocationServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/DelayedAllocationServiceTests.java index e38f09e567a39..b168bae87de41 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/DelayedAllocationServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/DelayedAllocationServiceTests.java @@ -69,7 +69,7 @@ public void createDelayedAllocationService() { threadPool = new TestThreadPool(getTestName()); clusterService = mock(ClusterService.class); allocationService = createAllocationService(Settings.EMPTY, new DelayedShardsMockGatewayAllocator()); - delayedAllocationService = new TestDelayAllocationService(Settings.EMPTY, threadPool, clusterService, allocationService); + delayedAllocationService = new TestDelayAllocationService(threadPool, clusterService, allocationService); verify(clusterService).addListener(delayedAllocationService); } @@ -464,9 +464,9 @@ public void testDelayedUnassignedScheduleRerouteRescheduledOnShorterDelay() thro private static class TestDelayAllocationService extends DelayedAllocationService { private volatile long nanoTimeOverride = -1L; - TestDelayAllocationService(Settings settings, ThreadPool threadPool, ClusterService clusterService, - AllocationService allocationService) { - super(settings, threadPool, clusterService, allocationService); + private TestDelayAllocationService(ThreadPool threadPool, ClusterService clusterService, + AllocationService allocationService) { + super(threadPool, clusterService, allocationService); } @Override diff --git a/server/src/test/java/org/elasticsearch/cluster/routing/RoutingServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/routing/RoutingServiceTests.java index 09b957069a624..f9d3e0ab95c01 100644 --- a/server/src/test/java/org/elasticsearch/cluster/routing/RoutingServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/routing/RoutingServiceTests.java @@ -19,7 +19,6 @@ package org.elasticsearch.cluster.routing; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.cluster.ESAllocationTestCase; import org.junit.Before; @@ -47,7 +46,7 @@ private class TestRoutingService extends RoutingService { private AtomicBoolean rerouted = new AtomicBoolean(); TestRoutingService() { - super(Settings.EMPTY, null, null); + super(null, null); } public boolean hasReroutedAndClear() { diff --git a/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java b/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java index 53051003243ae..abed28cd116e3 100644 --- a/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java +++ b/server/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java @@ -73,9 +73,6 @@ public void tearDown() throws Exception { } static class FakeHttpTransport extends AbstractLifecycleComponent implements HttpServerTransport { - FakeHttpTransport() { - super(null); - } @Override protected void doStart() {} @Override diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index e1c3aa9a0c440..733f066f36e11 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -3111,7 +3111,6 @@ private abstract static class RestoreOnlyRepository extends AbstractLifecycleCom private final String indexName; RestoreOnlyRepository(String indexName) { - super(Settings.EMPTY); this.indexName = indexName; } diff --git a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java index 284cd7af1b42c..00800cc157bdb 100644 --- a/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java +++ b/server/src/test/java/org/elasticsearch/rest/RestControllerTests.java @@ -473,7 +473,6 @@ private static final class TestHttpServerTransport extends AbstractLifecycleComp HttpServerTransport { TestHttpServerTransport() { - super(Settings.EMPTY); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java index e9942e4bc21fc..6383ab086d30e 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java @@ -163,7 +163,7 @@ public Collection createComponents( return emptyList(); } - CcrRestoreSourceService restoreSourceService = new CcrRestoreSourceService(settings); + CcrRestoreSourceService restoreSourceService = new CcrRestoreSourceService(); this.restoreSourceService.set(restoreSourceService); return Arrays.asList( ccrLicenseChecker, diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrRepositoryManager.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrRepositoryManager.java index 87e680b10a0d9..feecdb73defe9 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrRepositoryManager.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/CcrRepositoryManager.java @@ -28,7 +28,6 @@ class CcrRepositoryManager extends AbstractLifecycleComponent { private final RemoteSettingsUpdateListener updateListener; CcrRepositoryManager(Settings settings, ClusterService clusterService, NodeClient client) { - super(settings); this.client = client; updateListener = new RemoteSettingsUpdateListener(settings); updateListener.listenForUpdates(clusterService.getClusterSettings()); diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java index 1dcf2d51aea73..fab2f1b018c12 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRepository.java @@ -72,7 +72,6 @@ public class CcrRepository extends AbstractLifecycleComponent implements Reposit private final CcrLicenseChecker ccrLicenseChecker; public CcrRepository(RepositoryMetaData metadata, Client client, CcrLicenseChecker ccrLicenseChecker, Settings settings) { - super(settings); this.metadata = metadata; assert metadata.name().startsWith(NAME_PREFIX) : "CcrRepository metadata.name() must start with: " + NAME_PREFIX; this.remoteClusterAlias = Strings.split(metadata.name(), NAME_PREFIX)[1]; diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceService.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceService.java index 642036168ad7b..c7a022ae34569 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceService.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceService.java @@ -38,10 +38,6 @@ public class CcrRestoreSourceService extends AbstractLifecycleComponent implemen private final CopyOnWriteArrayList> openSessionListeners = new CopyOnWriteArrayList<>(); private final CopyOnWriteArrayList> closeSessionListeners = new CopyOnWriteArrayList<>(); - public CcrRestoreSourceService(Settings settings) { - super(settings); - } - @Override public synchronized void afterIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings) { if (indexShard != null) { diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceServiceTests.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceServiceTests.java index dfa7e5ef12660..0ab03a93995f8 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceServiceTests.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/repository/CcrRestoreSourceServiceTests.java @@ -23,7 +23,7 @@ public class CcrRestoreSourceServiceTests extends IndexShardTestCase { @Before public void setUp() throws Exception { super.setUp(); - restoreSourceService = new CcrRestoreSourceService(Settings.EMPTY); + restoreSourceService = new CcrRestoreSourceService(); } public void testOpenSession() throws IOException { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java index dbf11026f4709..68e094511a3e8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java @@ -121,7 +121,6 @@ public class LicenseService extends AbstractLifecycleComponent implements Cluste public LicenseService(Settings settings, ClusterService clusterService, Clock clock, Environment env, ResourceWatcherService resourceWatcherService, XPackLicenseState licenseState) { - super(settings); this.settings = settings; this.clusterService = clusterService; this.clock = clock; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringService.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringService.java index a07da2742378d..5ac386c7bef03 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringService.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/MonitoringService.java @@ -118,7 +118,6 @@ private static void deprecateMinusOne(final TimeValue value) { MonitoringService(Settings settings, ClusterService clusterService, ThreadPool threadPool, Set collectors, Exporters exporters) { - super(settings); this.clusterService = Objects.requireNonNull(clusterService); this.threadPool = Objects.requireNonNull(threadPool); this.collectors = Objects.requireNonNull(collectors); diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java index f9f41974402b1..e6af45ee2bca0 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/cleaner/CleanerService.java @@ -40,7 +40,6 @@ public class CleanerService extends AbstractLifecycleComponent { CleanerService(Settings settings, ClusterSettings clusterSettings, XPackLicenseState licenseState, ThreadPool threadPool, ExecutionScheduler executionScheduler) { - super(settings); this.licenseState = licenseState; this.threadPool = threadPool; this.executionScheduler = executionScheduler; diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporters.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporters.java index 54d4fde4fbbdf..484361ddc542e 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporters.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporters.java @@ -51,7 +51,6 @@ public class Exporters extends AbstractLifecycleComponent { public Exporters(Settings settings, Map factories, ClusterService clusterService, XPackLicenseState licenseState, ThreadContext threadContext) { - super(settings); this.settings = settings; this.factories = factories; this.exporters = new AtomicReference<>(emptyMap()); diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringServiceTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringServiceTests.java index f262d56fac857..bbe205ae939c3 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringServiceTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringServiceTests.java @@ -186,7 +186,6 @@ class BlockingExporter extends CountingExporter { private final CountDownLatch latch; BlockingExporter(CountDownLatch latch) { - super(); this.latch = latch; }