The AbstracLifecycleComponent used to extend AbstractComponent, so it had to pass settings to the constractor of its supper class. It no longer extends the AbstractComponent so there is no need for this constructor There is also no need for AbstracLifecycleComponent subclasses to have Settings in their constructors if they were only passing it over to super constructor. This is part 1. which will be backported to 6.x with a migration guide/deprecation log. part 2 will have this constructor removed in 7 relates #35560 relates #34488
This commit is contained in:
parent
15d1b904a1
commit
5e94f384c4
|
@ -52,7 +52,6 @@ public class AzureComputeServiceImpl extends AbstractLifecycleComponent
|
||||||
private final String serviceName;
|
private final String serviceName;
|
||||||
|
|
||||||
public AzureComputeServiceImpl(Settings settings) {
|
public AzureComputeServiceImpl(Settings settings) {
|
||||||
super(settings);
|
|
||||||
String subscriptionId = getRequiredSetting(settings, Management.SUBSCRIPTION_ID_SETTING);
|
String subscriptionId = getRequiredSetting(settings, Management.SUBSCRIPTION_ID_SETTING);
|
||||||
|
|
||||||
serviceName = getRequiredSetting(settings, Management.SERVICE_NAME_SETTING);
|
serviceName = getRequiredSetting(settings, Management.SERVICE_NAME_SETTING);
|
||||||
|
|
|
@ -53,7 +53,6 @@ public class GceMetadataService extends AbstractLifecycleComponent {
|
||||||
private HttpTransport gceHttpTransport;
|
private HttpTransport gceHttpTransport;
|
||||||
|
|
||||||
public GceMetadataService(Settings settings) {
|
public GceMetadataService(Settings settings) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,6 @@ public class NodeConnectionsService extends AbstractLifecycleComponent {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NodeConnectionsService(Settings settings, ThreadPool threadPool, TransportService transportService) {
|
public NodeConnectionsService(Settings settings, ThreadPool threadPool, TransportService transportService) {
|
||||||
super(settings);
|
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.transportService = transportService;
|
this.transportService = transportService;
|
||||||
this.reconnectInterval = NodeConnectionsService.CLUSTER_NODE_RECONNECT_INTERVAL_SETTING.get(settings);
|
this.reconnectInterval = NodeConnectionsService.CLUSTER_NODE_RECONNECT_INTERVAL_SETTING.get(settings);
|
||||||
|
|
|
@ -145,7 +145,6 @@ public class Coordinator extends AbstractLifecycleComponent implements Discovery
|
||||||
NamedWriteableRegistry namedWriteableRegistry, AllocationService allocationService, MasterService masterService,
|
NamedWriteableRegistry namedWriteableRegistry, AllocationService allocationService, MasterService masterService,
|
||||||
Supplier<CoordinationState.PersistedState> persistedStateSupplier, UnicastHostsProvider unicastHostsProvider,
|
Supplier<CoordinationState.PersistedState> persistedStateSupplier, UnicastHostsProvider unicastHostsProvider,
|
||||||
ClusterApplier clusterApplier, Collection<BiConsumer<DiscoveryNode, ClusterState>> onJoinValidators, Random random) {
|
ClusterApplier clusterApplier, Collection<BiConsumer<DiscoveryNode, ClusterState>> onJoinValidators, Random random) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.transportService = transportService;
|
this.transportService = transportService;
|
||||||
this.masterService = masterService;
|
this.masterService = masterService;
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
||||||
import org.elasticsearch.common.util.concurrent.FutureUtils;
|
import org.elasticsearch.common.util.concurrent.FutureUtils;
|
||||||
|
@ -130,9 +129,8 @@ public class DelayedAllocationService extends AbstractLifecycleComponent impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DelayedAllocationService(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
public DelayedAllocationService(ThreadPool threadPool, ClusterService clusterService,
|
||||||
AllocationService allocationService) {
|
AllocationService allocationService) {
|
||||||
super(settings);
|
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
this.allocationService = allocationService;
|
this.allocationService = allocationService;
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.Priority;
|
import org.elasticsearch.common.Priority;
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
|
@ -57,8 +56,7 @@ public class RoutingService extends AbstractLifecycleComponent {
|
||||||
private AtomicBoolean rerouting = new AtomicBoolean();
|
private AtomicBoolean rerouting = new AtomicBoolean();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public RoutingService(Settings settings, ClusterService clusterService, AllocationService allocationService) {
|
public RoutingService(ClusterService clusterService, AllocationService allocationService) {
|
||||||
super(settings);
|
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
this.allocationService = allocationService;
|
this.allocationService = allocationService;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,6 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements
|
||||||
private NodeConnectionsService nodeConnectionsService;
|
private NodeConnectionsService nodeConnectionsService;
|
||||||
|
|
||||||
public ClusterApplierService(String nodeName, Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool) {
|
public ClusterApplierService(String nodeName, Settings settings, ClusterSettings clusterSettings, ThreadPool threadPool) {
|
||||||
super(settings);
|
|
||||||
this.clusterSettings = clusterSettings;
|
this.clusterSettings = clusterSettings;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.state = new AtomicReference<>();
|
this.state = new AtomicReference<>();
|
||||||
|
|
|
@ -78,7 +78,6 @@ public class ClusterService extends AbstractLifecycleComponent {
|
||||||
|
|
||||||
public ClusterService(Settings settings, ClusterSettings clusterSettings, MasterService masterService,
|
public ClusterService(Settings settings, ClusterSettings clusterSettings, MasterService masterService,
|
||||||
ClusterApplierService clusterApplierService) {
|
ClusterApplierService clusterApplierService) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.nodeName = Node.NODE_NAME_SETTING.get(settings);
|
this.nodeName = Node.NODE_NAME_SETTING.get(settings);
|
||||||
this.masterService = masterService;
|
this.masterService = masterService;
|
||||||
|
|
|
@ -87,7 +87,6 @@ public class MasterService extends AbstractLifecycleComponent {
|
||||||
private volatile Batcher taskBatcher;
|
private volatile Batcher taskBatcher;
|
||||||
|
|
||||||
public MasterService(String nodeName, Settings settings, ThreadPool threadPool) {
|
public MasterService(String nodeName, Settings settings, ThreadPool threadPool) {
|
||||||
super(settings);
|
|
||||||
this.nodeName = nodeName;
|
this.nodeName = nodeName;
|
||||||
// TODO: introduce a dedicated setting for master service
|
// TODO: introduce a dedicated setting for master service
|
||||||
this.slowTaskLoggingThreshold = CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings);
|
this.slowTaskLoggingThreshold = CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings);
|
||||||
|
|
|
@ -34,6 +34,9 @@ public abstract class AbstractLifecycleComponent implements LifecycleComponent {
|
||||||
|
|
||||||
private final List<LifecycleListener> listeners = new CopyOnWriteArrayList<>();
|
private final List<LifecycleListener> listeners = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
|
protected AbstractLifecycleComponent() {}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
protected AbstractLifecycleComponent(Settings settings) {
|
protected AbstractLifecycleComponent(Settings settings) {
|
||||||
// TODO drop settings from ctor
|
// TODO drop settings from ctor
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@ public class UnicastConfiguredHostsResolver extends AbstractLifecycleComponent i
|
||||||
|
|
||||||
public UnicastConfiguredHostsResolver(String nodeName, Settings settings, TransportService transportService,
|
public UnicastConfiguredHostsResolver(String nodeName, Settings settings, TransportService transportService,
|
||||||
UnicastHostsProvider hostsProvider) {
|
UnicastHostsProvider hostsProvider) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.nodeName = nodeName;
|
this.nodeName = nodeName;
|
||||||
this.transportService = transportService;
|
this.transportService = transportService;
|
||||||
|
|
|
@ -59,7 +59,6 @@ public class SingleNodeDiscovery extends AbstractLifecycleComponent implements D
|
||||||
public SingleNodeDiscovery(final Settings settings, final TransportService transportService,
|
public SingleNodeDiscovery(final Settings settings, final TransportService transportService,
|
||||||
final MasterService masterService, final ClusterApplier clusterApplier,
|
final MasterService masterService, final ClusterApplier clusterApplier,
|
||||||
final GatewayMetaState gatewayMetaState) {
|
final GatewayMetaState gatewayMetaState) {
|
||||||
super(Objects.requireNonNull(settings));
|
|
||||||
this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings);
|
this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings);
|
||||||
this.transportService = Objects.requireNonNull(transportService);
|
this.transportService = Objects.requireNonNull(transportService);
|
||||||
masterService.setClusterStateSupplier(() -> clusterState);
|
masterService.setClusterStateSupplier(() -> clusterState);
|
||||||
|
|
|
@ -161,7 +161,6 @@ public class ZenDiscovery extends AbstractLifecycleComponent implements Discover
|
||||||
NamedWriteableRegistry namedWriteableRegistry, MasterService masterService, ClusterApplier clusterApplier,
|
NamedWriteableRegistry namedWriteableRegistry, MasterService masterService, ClusterApplier clusterApplier,
|
||||||
ClusterSettings clusterSettings, UnicastHostsProvider hostsProvider, AllocationService allocationService,
|
ClusterSettings clusterSettings, UnicastHostsProvider hostsProvider, AllocationService allocationService,
|
||||||
Collection<BiConsumer<DiscoveryNode, ClusterState>> onJoinValidators, GatewayMetaState gatewayMetaState) {
|
Collection<BiConsumer<DiscoveryNode, ClusterState>> onJoinValidators, GatewayMetaState gatewayMetaState) {
|
||||||
super(settings);
|
|
||||||
this.onJoinValidators = JoinTaskExecutor.addBuiltInJoinValidators(onJoinValidators);
|
this.onJoinValidators = JoinTaskExecutor.addBuiltInJoinValidators(onJoinValidators);
|
||||||
this.masterService = masterService;
|
this.masterService = masterService;
|
||||||
this.clusterApplier = clusterApplier;
|
this.clusterApplier = clusterApplier;
|
||||||
|
|
|
@ -95,7 +95,6 @@ public class GatewayService extends AbstractLifecycleComponent implements Cluste
|
||||||
final ThreadPool threadPool,
|
final ThreadPool threadPool,
|
||||||
final TransportNodesListGatewayMetaState listGatewayMetaState,
|
final TransportNodesListGatewayMetaState listGatewayMetaState,
|
||||||
final IndicesService indicesService, final Discovery discovery) {
|
final IndicesService indicesService, final Discovery discovery) {
|
||||||
super(settings);
|
|
||||||
this.allocationService = allocationService;
|
this.allocationService = allocationService;
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
|
|
|
@ -87,7 +87,6 @@ public abstract class AbstractHttpServerTransport extends AbstractLifecycleCompo
|
||||||
|
|
||||||
protected AbstractHttpServerTransport(Settings settings, NetworkService networkService, BigArrays bigArrays, ThreadPool threadPool,
|
protected AbstractHttpServerTransport(Settings settings, NetworkService networkService, BigArrays bigArrays, ThreadPool threadPool,
|
||||||
NamedXContentRegistry xContentRegistry, Dispatcher dispatcher) {
|
NamedXContentRegistry xContentRegistry, Dispatcher dispatcher) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.networkService = networkService;
|
this.networkService = networkService;
|
||||||
this.bigArrays = bigArrays;
|
this.bigArrays = bigArrays;
|
||||||
|
|
|
@ -205,7 +205,6 @@ public class IndicesService extends AbstractLifecycleComponent
|
||||||
ScriptService scriptService, Client client, MetaStateService metaStateService,
|
ScriptService scriptService, Client client, MetaStateService metaStateService,
|
||||||
Collection<Function<IndexSettings, Optional<EngineFactory>>> engineFactoryProviders,
|
Collection<Function<IndexSettings, Optional<EngineFactory>>> engineFactoryProviders,
|
||||||
Map<String, Function<IndexSettings, IndexStore>> indexStoreFactories) {
|
Map<String, Function<IndexSettings, IndexStore>> indexStoreFactories) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.pluginsService = pluginsService;
|
this.pluginsService = pluginsService;
|
||||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for Circuit Breaker services, which provide breakers to classes
|
* Interface for Circuit Breaker services, which provide breakers to classes
|
||||||
|
@ -32,8 +31,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
public abstract class CircuitBreakerService extends AbstractLifecycleComponent {
|
public abstract class CircuitBreakerService extends AbstractLifecycleComponent {
|
||||||
private static final Logger logger = LogManager.getLogger(CircuitBreakerService.class);
|
private static final Logger logger = LogManager.getLogger(CircuitBreakerService.class);
|
||||||
|
|
||||||
protected CircuitBreakerService(Settings settings) {
|
protected CircuitBreakerService() {
|
||||||
super(settings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class HierarchyCircuitBreakerService extends CircuitBreakerService {
|
||||||
private final AtomicLong parentTripCount = new AtomicLong(0);
|
private final AtomicLong parentTripCount = new AtomicLong(0);
|
||||||
|
|
||||||
public HierarchyCircuitBreakerService(Settings settings, ClusterSettings clusterSettings) {
|
public HierarchyCircuitBreakerService(Settings settings, ClusterSettings clusterSettings) {
|
||||||
super(settings);
|
super();
|
||||||
this.fielddataSettings = new BreakerSettings(CircuitBreaker.FIELDDATA,
|
this.fielddataSettings = new BreakerSettings(CircuitBreaker.FIELDDATA,
|
||||||
FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(),
|
FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING.get(settings).getBytes(),
|
||||||
FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings),
|
FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING.get(settings),
|
||||||
|
|
|
@ -21,7 +21,6 @@ package org.elasticsearch.indices.breaker;
|
||||||
|
|
||||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||||
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
|
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that returns a breaker that never breaks
|
* 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);
|
private final CircuitBreaker breaker = new NoopCircuitBreaker(CircuitBreaker.FIELDDATA);
|
||||||
|
|
||||||
public NoneCircuitBreakerService() {
|
public NoneCircuitBreakerService() {
|
||||||
super(Settings.EMPTY);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -171,7 +171,6 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent imple
|
||||||
final SnapshotShardsService snapshotShardsService,
|
final SnapshotShardsService snapshotShardsService,
|
||||||
final PrimaryReplicaSyncer primaryReplicaSyncer,
|
final PrimaryReplicaSyncer primaryReplicaSyncer,
|
||||||
final Consumer<ShardId> globalCheckpointSyncer) {
|
final Consumer<ShardId> globalCheckpointSyncer) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.buildInIndexListener =
|
this.buildInIndexListener =
|
||||||
Arrays.asList(
|
Arrays.asList(
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class MonitorService extends AbstractLifecycleComponent {
|
||||||
|
|
||||||
public MonitorService(Settings settings, NodeEnvironment nodeEnvironment, ThreadPool threadPool,
|
public MonitorService(Settings settings, NodeEnvironment nodeEnvironment, ThreadPool threadPool,
|
||||||
ClusterInfoService clusterInfoService) throws IOException {
|
ClusterInfoService clusterInfoService) throws IOException {
|
||||||
super(settings);
|
|
||||||
this.jvmGcMonitorService = new JvmGcMonitorService(settings, threadPool);
|
this.jvmGcMonitorService = new JvmGcMonitorService(settings, threadPool);
|
||||||
this.osService = new OsService(settings);
|
this.osService = new OsService(settings);
|
||||||
this.processService = new ProcessService(settings);
|
this.processService = new ProcessService(settings);
|
||||||
|
|
|
@ -107,7 +107,6 @@ public class JvmGcMonitorService extends AbstractLifecycleComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public JvmGcMonitorService(Settings settings, ThreadPool threadPool) {
|
public JvmGcMonitorService(Settings settings, ThreadPool threadPool) {
|
||||||
super(settings);
|
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
|
|
||||||
this.enabled = ENABLED_SETTING.get(settings);
|
this.enabled = ENABLED_SETTING.get(settings);
|
||||||
|
|
|
@ -228,7 +228,6 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
|
||||||
* @param settings Settings for the node this repository object is created on
|
* @param settings Settings for the node this repository object is created on
|
||||||
*/
|
*/
|
||||||
protected BlobStoreRepository(RepositoryMetaData metadata, Settings settings, NamedXContentRegistry namedXContentRegistry) {
|
protected BlobStoreRepository(RepositoryMetaData metadata, Settings settings, NamedXContentRegistry namedXContentRegistry) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
this.namedXContentRegistry = namedXContentRegistry;
|
this.namedXContentRegistry = namedXContentRegistry;
|
||||||
|
|
|
@ -193,7 +193,6 @@ public class SearchService extends AbstractLifecycleComponent implements IndexEv
|
||||||
public SearchService(ClusterService clusterService, IndicesService indicesService,
|
public SearchService(ClusterService clusterService, IndicesService indicesService,
|
||||||
ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase,
|
ThreadPool threadPool, ScriptService scriptService, BigArrays bigArrays, FetchPhase fetchPhase,
|
||||||
ResponseCollectorService responseCollectorService) {
|
ResponseCollectorService responseCollectorService) {
|
||||||
super(clusterService.getSettings());
|
|
||||||
Settings settings = clusterService.getSettings();
|
Settings settings = clusterService.getSettings();
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
|
|
|
@ -119,7 +119,6 @@ public class SnapshotShardsService extends AbstractLifecycleComponent implements
|
||||||
public SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService,
|
public SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService,
|
||||||
ThreadPool threadPool, TransportService transportService, IndicesService indicesService,
|
ThreadPool threadPool, TransportService transportService, IndicesService indicesService,
|
||||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||||
super(settings);
|
|
||||||
this.indicesService = indicesService;
|
this.indicesService = indicesService;
|
||||||
this.snapshotsService = snapshotsService;
|
this.snapshotsService = snapshotsService;
|
||||||
this.transportService = transportService;
|
this.transportService = transportService;
|
||||||
|
|
|
@ -124,7 +124,6 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus
|
||||||
@Inject
|
@Inject
|
||||||
public SnapshotsService(Settings settings, ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver,
|
public SnapshotsService(Settings settings, ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||||
RepositoriesService repositoriesService, ThreadPool threadPool) {
|
RepositoriesService repositoriesService, ThreadPool threadPool) {
|
||||||
super(settings);
|
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.repositoriesService = repositoriesService;
|
this.repositoriesService = repositoriesService;
|
||||||
|
|
|
@ -156,7 +156,6 @@ public abstract class TcpTransport extends AbstractLifecycleComponent implements
|
||||||
public TcpTransport(String transportName, Settings settings, Version version, ThreadPool threadPool,
|
public TcpTransport(String transportName, Settings settings, Version version, ThreadPool threadPool,
|
||||||
PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService,
|
PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService,
|
||||||
NamedWriteableRegistry namedWriteableRegistry, NetworkService networkService) {
|
NamedWriteableRegistry namedWriteableRegistry, NetworkService networkService) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.profileSettings = getProfileSettings(settings);
|
this.profileSettings = getProfileSettings(settings);
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
|
|
@ -155,7 +155,6 @@ public class TransportService extends AbstractLifecycleComponent implements Tran
|
||||||
public TransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor transportInterceptor,
|
public TransportService(Settings settings, Transport transport, ThreadPool threadPool, TransportInterceptor transportInterceptor,
|
||||||
Function<BoundTransportAddress, DiscoveryNode> localNodeFactory, @Nullable ClusterSettings clusterSettings,
|
Function<BoundTransportAddress, DiscoveryNode> localNodeFactory, @Nullable ClusterSettings clusterSettings,
|
||||||
Set<String> taskHeaders, ConnectionManager connectionManager) {
|
Set<String> 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
|
// 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 ||
|
this.validateConnections = TransportClient.CLIENT_TYPE.equals(settings.get(Client.CLIENT_TYPE_SETTING_S.getKey())) == false ||
|
||||||
TransportClient.CLIENT_TRANSPORT_SNIFF.get(settings);
|
TransportClient.CLIENT_TRANSPORT_SNIFF.get(settings);
|
||||||
|
|
|
@ -90,7 +90,6 @@ public class ResourceWatcherService extends AbstractLifecycleComponent {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ResourceWatcherService(Settings settings, ThreadPool threadPool) {
|
public ResourceWatcherService(Settings settings, ThreadPool threadPool) {
|
||||||
super(settings);
|
|
||||||
this.enabled = ENABLED.get(settings);
|
this.enabled = ENABLED.get(settings);
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class DelayedAllocationServiceTests extends ESAllocationTestCase {
|
||||||
threadPool = new TestThreadPool(getTestName());
|
threadPool = new TestThreadPool(getTestName());
|
||||||
clusterService = mock(ClusterService.class);
|
clusterService = mock(ClusterService.class);
|
||||||
allocationService = createAllocationService(Settings.EMPTY, new DelayedShardsMockGatewayAllocator());
|
allocationService = createAllocationService(Settings.EMPTY, new DelayedShardsMockGatewayAllocator());
|
||||||
delayedAllocationService = new TestDelayAllocationService(Settings.EMPTY, threadPool, clusterService, allocationService);
|
delayedAllocationService = new TestDelayAllocationService(threadPool, clusterService, allocationService);
|
||||||
verify(clusterService).addListener(delayedAllocationService);
|
verify(clusterService).addListener(delayedAllocationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,9 +464,9 @@ public class DelayedAllocationServiceTests extends ESAllocationTestCase {
|
||||||
private static class TestDelayAllocationService extends DelayedAllocationService {
|
private static class TestDelayAllocationService extends DelayedAllocationService {
|
||||||
private volatile long nanoTimeOverride = -1L;
|
private volatile long nanoTimeOverride = -1L;
|
||||||
|
|
||||||
TestDelayAllocationService(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
private TestDelayAllocationService(ThreadPool threadPool, ClusterService clusterService,
|
||||||
AllocationService allocationService) {
|
AllocationService allocationService) {
|
||||||
super(settings, threadPool, clusterService, allocationService);
|
super(threadPool, clusterService, allocationService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package org.elasticsearch.cluster.routing;
|
package org.elasticsearch.cluster.routing;
|
||||||
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
import org.elasticsearch.cluster.ESAllocationTestCase;
|
import org.elasticsearch.cluster.ESAllocationTestCase;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
|
@ -47,7 +46,7 @@ public class RoutingServiceTests extends ESAllocationTestCase {
|
||||||
private AtomicBoolean rerouted = new AtomicBoolean();
|
private AtomicBoolean rerouted = new AtomicBoolean();
|
||||||
|
|
||||||
TestRoutingService() {
|
TestRoutingService() {
|
||||||
super(Settings.EMPTY, null, null);
|
super(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasReroutedAndClear() {
|
public boolean hasReroutedAndClear() {
|
||||||
|
|
|
@ -72,9 +72,6 @@ public class NetworkModuleTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
static class FakeHttpTransport extends AbstractLifecycleComponent implements HttpServerTransport {
|
static class FakeHttpTransport extends AbstractLifecycleComponent implements HttpServerTransport {
|
||||||
FakeHttpTransport() {
|
|
||||||
super(null);
|
|
||||||
}
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStart() {}
|
protected void doStart() {}
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3126,7 +3126,6 @@ public class IndexShardTests extends IndexShardTestCase {
|
||||||
private final String indexName;
|
private final String indexName;
|
||||||
|
|
||||||
RestoreOnlyRepository(String indexName) {
|
RestoreOnlyRepository(String indexName) {
|
||||||
super(Settings.EMPTY);
|
|
||||||
this.indexName = indexName;
|
this.indexName = indexName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -474,7 +474,6 @@ public class RestControllerTests extends ESTestCase {
|
||||||
HttpServerTransport {
|
HttpServerTransport {
|
||||||
|
|
||||||
TestHttpServerTransport() {
|
TestHttpServerTransport() {
|
||||||
super(Settings.EMPTY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -463,7 +463,7 @@ public class SnapshotsServiceTests extends ESTestCase {
|
||||||
transportService, indicesService, actionFilters, indexNameExpressionResolver);
|
transportService, indicesService, actionFilters, indexNameExpressionResolver);
|
||||||
final ShardStateAction shardStateAction = new ShardStateAction(
|
final ShardStateAction shardStateAction = new ShardStateAction(
|
||||||
clusterService, transportService, allocationService,
|
clusterService, transportService, allocationService,
|
||||||
new RoutingService(settings, clusterService, allocationService),
|
new RoutingService(clusterService, allocationService),
|
||||||
deterministicTaskQueue.getThreadPool()
|
deterministicTaskQueue.getThreadPool()
|
||||||
);
|
);
|
||||||
indicesClusterStateService = new IndicesClusterStateService(
|
indicesClusterStateService = new IndicesClusterStateService(
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
package org.elasticsearch.test;
|
package org.elasticsearch.test;
|
||||||
|
|
||||||
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
import org.elasticsearch.common.component.AbstractLifecycleComponent;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
|
||||||
import org.elasticsearch.common.transport.BoundTransportAddress;
|
import org.elasticsearch.common.transport.BoundTransportAddress;
|
||||||
import org.elasticsearch.common.transport.TransportAddress;
|
import org.elasticsearch.common.transport.TransportAddress;
|
||||||
import org.elasticsearch.http.HttpInfo;
|
import org.elasticsearch.http.HttpInfo;
|
||||||
|
@ -46,10 +45,6 @@ public class MockHttpTransport extends AbstractLifecycleComponent implements Htt
|
||||||
private static final HttpInfo DUMMY_HTTP_INFO = new HttpInfo(DUMMY_BOUND_ADDRESS, 0);
|
private static final HttpInfo DUMMY_HTTP_INFO = new HttpInfo(DUMMY_BOUND_ADDRESS, 0);
|
||||||
private static final HttpStats DUMMY_HTTP_STATS = new HttpStats(0, 0);
|
private static final HttpStats DUMMY_HTTP_STATS = new HttpStats(0, 0);
|
||||||
|
|
||||||
public MockHttpTransport() {
|
|
||||||
super(Settings.EMPTY);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doStart() {}
|
protected void doStart() {}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class Ccr extends Plugin implements ActionPlugin, PersistentTaskPlugin, E
|
||||||
return emptyList();
|
return emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
CcrRestoreSourceService restoreSourceService = new CcrRestoreSourceService(settings);
|
CcrRestoreSourceService restoreSourceService = new CcrRestoreSourceService();
|
||||||
this.restoreSourceService.set(restoreSourceService);
|
this.restoreSourceService.set(restoreSourceService);
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
ccrLicenseChecker,
|
ccrLicenseChecker,
|
||||||
|
|
|
@ -29,7 +29,6 @@ class CcrRepositoryManager extends AbstractLifecycleComponent {
|
||||||
private final RemoteSettingsUpdateListener updateListener;
|
private final RemoteSettingsUpdateListener updateListener;
|
||||||
|
|
||||||
CcrRepositoryManager(Settings settings, ClusterService clusterService, Client client) {
|
CcrRepositoryManager(Settings settings, ClusterService clusterService, Client client) {
|
||||||
super(settings);
|
|
||||||
this.client = client;
|
this.client = client;
|
||||||
updateListener = new RemoteSettingsUpdateListener(settings);
|
updateListener = new RemoteSettingsUpdateListener(settings);
|
||||||
updateListener.listenForUpdates(clusterService.getClusterSettings());
|
updateListener.listenForUpdates(clusterService.getClusterSettings());
|
||||||
|
|
|
@ -84,7 +84,6 @@ public class CcrRepository extends AbstractLifecycleComponent implements Reposit
|
||||||
private final CcrLicenseChecker ccrLicenseChecker;
|
private final CcrLicenseChecker ccrLicenseChecker;
|
||||||
|
|
||||||
public CcrRepository(RepositoryMetaData metadata, Client client, CcrLicenseChecker ccrLicenseChecker, Settings settings) {
|
public CcrRepository(RepositoryMetaData metadata, Client client, CcrLicenseChecker ccrLicenseChecker, Settings settings) {
|
||||||
super(settings);
|
|
||||||
this.metadata = metadata;
|
this.metadata = metadata;
|
||||||
assert metadata.name().startsWith(NAME_PREFIX) : "CcrRepository metadata.name() must start with: " + NAME_PREFIX;
|
assert metadata.name().startsWith(NAME_PREFIX) : "CcrRepository metadata.name() must start with: " + NAME_PREFIX;
|
||||||
this.remoteClusterAlias = Strings.split(metadata.name(), NAME_PREFIX)[1];
|
this.remoteClusterAlias = Strings.split(metadata.name(), NAME_PREFIX)[1];
|
||||||
|
|
|
@ -48,10 +48,6 @@ public class CcrRestoreSourceService extends AbstractLifecycleComponent implemen
|
||||||
private final CopyOnWriteArrayList<Consumer<String>> openSessionListeners = new CopyOnWriteArrayList<>();
|
private final CopyOnWriteArrayList<Consumer<String>> openSessionListeners = new CopyOnWriteArrayList<>();
|
||||||
private final CopyOnWriteArrayList<Consumer<String>> closeSessionListeners = new CopyOnWriteArrayList<>();
|
private final CopyOnWriteArrayList<Consumer<String>> closeSessionListeners = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
public CcrRestoreSourceService(Settings settings) {
|
|
||||||
super(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void afterIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings) {
|
public synchronized void afterIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings) {
|
||||||
if (indexShard != null) {
|
if (indexShard != null) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class CcrRestoreSourceServiceTests extends IndexShardTestCase {
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
restoreSourceService = new CcrRestoreSourceService(Settings.EMPTY);
|
restoreSourceService = new CcrRestoreSourceService();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOpenSession() throws IOException {
|
public void testOpenSession() throws IOException {
|
||||||
|
|
|
@ -121,7 +121,6 @@ public class LicenseService extends AbstractLifecycleComponent implements Cluste
|
||||||
|
|
||||||
public LicenseService(Settings settings, ClusterService clusterService, Clock clock, Environment env,
|
public LicenseService(Settings settings, ClusterService clusterService, Clock clock, Environment env,
|
||||||
ResourceWatcherService resourceWatcherService, XPackLicenseState licenseState) {
|
ResourceWatcherService resourceWatcherService, XPackLicenseState licenseState) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
this.clock = clock;
|
this.clock = clock;
|
||||||
|
|
|
@ -91,7 +91,6 @@ public class MonitoringService extends AbstractLifecycleComponent {
|
||||||
|
|
||||||
MonitoringService(Settings settings, ClusterService clusterService, ThreadPool threadPool,
|
MonitoringService(Settings settings, ClusterService clusterService, ThreadPool threadPool,
|
||||||
Set<Collector> collectors, Exporters exporters) {
|
Set<Collector> collectors, Exporters exporters) {
|
||||||
super(settings);
|
|
||||||
this.clusterService = Objects.requireNonNull(clusterService);
|
this.clusterService = Objects.requireNonNull(clusterService);
|
||||||
this.threadPool = Objects.requireNonNull(threadPool);
|
this.threadPool = Objects.requireNonNull(threadPool);
|
||||||
this.collectors = Objects.requireNonNull(collectors);
|
this.collectors = Objects.requireNonNull(collectors);
|
||||||
|
|
|
@ -40,7 +40,6 @@ public class CleanerService extends AbstractLifecycleComponent {
|
||||||
|
|
||||||
CleanerService(Settings settings, ClusterSettings clusterSettings, XPackLicenseState licenseState, ThreadPool threadPool,
|
CleanerService(Settings settings, ClusterSettings clusterSettings, XPackLicenseState licenseState, ThreadPool threadPool,
|
||||||
ExecutionScheduler executionScheduler) {
|
ExecutionScheduler executionScheduler) {
|
||||||
super(settings);
|
|
||||||
this.licenseState = licenseState;
|
this.licenseState = licenseState;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.executionScheduler = executionScheduler;
|
this.executionScheduler = executionScheduler;
|
||||||
|
|
|
@ -51,7 +51,6 @@ public class Exporters extends AbstractLifecycleComponent {
|
||||||
public Exporters(Settings settings, Map<String, Exporter.Factory> factories,
|
public Exporters(Settings settings, Map<String, Exporter.Factory> factories,
|
||||||
ClusterService clusterService, XPackLicenseState licenseState,
|
ClusterService clusterService, XPackLicenseState licenseState,
|
||||||
ThreadContext threadContext) {
|
ThreadContext threadContext) {
|
||||||
super(settings);
|
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.factories = factories;
|
this.factories = factories;
|
||||||
this.exporters = new AtomicReference<>(emptyMap());
|
this.exporters = new AtomicReference<>(emptyMap());
|
||||||
|
|
|
@ -173,7 +173,6 @@ public class MonitoringServiceTests extends ESTestCase {
|
||||||
private final CountDownLatch latch;
|
private final CountDownLatch latch;
|
||||||
|
|
||||||
BlockingExporter(CountDownLatch latch) {
|
BlockingExporter(CountDownLatch latch) {
|
||||||
super();
|
|
||||||
this.latch = latch;
|
this.latch = latch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue