mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-28 10:58:30 +00:00
Remove use of AbstractComponent in server (#35444)
Removed extending of AbstractComponent and changed logger usage to explicit declaration. Abstract classes still have logger declaration using this.getClass() in order to show implementation class name in its logs. See #34488
This commit is contained in:
parent
c6a0904e0e
commit
022726011c
server/src
main/java/org/elasticsearch
action
client
cluster
InternalClusterInfoService.java
action
metadata
MetaDataCreateIndexService.javaMetaDataDeleteIndexService.javaMetaDataIndexStateService.javaMetaDataIndexTemplateService.javaMetaDataIndexUpgradeService.javaMetaDataMappingService.javaMetaDataUpdateSettingsService.javaTemplateUpgradeService.java
routing
common
discovery
gateway
BaseGatewayShardAllocator.javaDanglingIndicesState.javaGateway.javaGatewayAllocator.javaGatewayMetaState.javaLocalAllocateDangledIndices.javaMetaStateService.java
index
indices
IndexingMemoryController.javaIndicesQueryCache.javaIndicesRequestCache.java
analysis
fielddata/cache
flush
recovery
store
monitor
node
persistent
PersistentTasksClusterService.javaPersistentTasksExecutor.javaPersistentTasksNodeService.javaPersistentTasksService.java
plugins
repositories
rest
script
snapshots
tasks
threadpool
transport
test/java/org/elasticsearch
test/framework/src/main/java/org/elasticsearch/test/tasks
x-pack/plugin
ccr/src/main/java/org/elasticsearch/xpack/ccr/action
ml/src/main/java/org/elasticsearch/xpack/ml/action
@ -19,11 +19,12 @@
|
||||
|
||||
package org.elasticsearch.action.support;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.ClusterStateObserver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.node.NodeClosedException;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -36,7 +37,9 @@ import java.util.function.Predicate;
|
||||
* This class provides primitives for waiting for a configured number of shards
|
||||
* to become active before sending a response on an {@link ActionListener}.
|
||||
*/
|
||||
public class ActiveShardsObserver extends AbstractComponent {
|
||||
public class ActiveShardsObserver {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ActiveShardsObserver.class);
|
||||
|
||||
private final ClusterService clusterService;
|
||||
private final ThreadPool threadPool;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.action.update;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.action.DocWriteResponse;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.client.Requests;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -55,7 +55,9 @@ import java.util.function.LongSupplier;
|
||||
/**
|
||||
* Helper for translating an update request to an index, delete request or update response.
|
||||
*/
|
||||
public class UpdateHelper extends AbstractComponent {
|
||||
public class UpdateHelper {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(UpdateHelper.class);
|
||||
|
||||
private final ScriptService scriptService;
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.client.support;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.Action;
|
||||
import org.elasticsearch.action.ActionFuture;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -333,7 +335,6 @@ import org.elasticsearch.client.FilterClient;
|
||||
import org.elasticsearch.client.IndicesAdminClient;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
@ -342,7 +343,9 @@ import org.elasticsearch.threadpool.ThreadPool;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AbstractClient extends AbstractComponent implements Client {
|
||||
public abstract class AbstractClient implements Client {
|
||||
|
||||
protected final Logger logger;
|
||||
|
||||
protected final Settings settings;
|
||||
private final ThreadPool threadPool;
|
||||
@ -353,6 +356,7 @@ public abstract class AbstractClient extends AbstractComponent implements Client
|
||||
this.settings = settings;
|
||||
this.threadPool = threadPool;
|
||||
this.admin = new Admin(this);
|
||||
this.logger =LogManager.getLogger(this.getClass());
|
||||
this.threadedWrapper = new ThreadedActionListener.Wrapper(logger, settings, threadPool);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.client.transport;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.core.internal.io.IOUtils;
|
||||
@ -35,7 +37,6 @@ import org.elasticsearch.client.Requests;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.Randomness;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
@ -70,7 +71,9 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
final class TransportClientNodesService extends AbstractComponent implements Closeable {
|
||||
final class TransportClientNodesService implements Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TransportClientNodesService.class);
|
||||
|
||||
private final TimeValue nodesSamplerInterval;
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.LatchedActionListener;
|
||||
@ -35,7 +36,6 @@ import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -62,8 +62,9 @@ import java.util.function.Consumer;
|
||||
* Every time the timer runs, gathers information about the disk usage and
|
||||
* shard sizes across the cluster.
|
||||
*/
|
||||
public class InternalClusterInfoService extends AbstractComponent
|
||||
implements ClusterInfoService, LocalNodeMasterListener, ClusterStateListener {
|
||||
public class InternalClusterInfoService implements ClusterInfoService, LocalNodeMasterListener, ClusterStateListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(InternalClusterInfoService.class);
|
||||
|
||||
public static final Setting<TimeValue> INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING =
|
||||
Setting.timeSetting("cluster.info.update.interval", TimeValue.timeValueSeconds(30), TimeValue.timeValueSeconds(10),
|
||||
|
@ -19,12 +19,13 @@
|
||||
|
||||
package org.elasticsearch.cluster.action.index;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.IndicesRequest;
|
||||
import org.elasticsearch.action.support.IndicesOptions;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MetaDataMappingService;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -39,7 +40,9 @@ import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class NodeMappingRefreshAction extends AbstractComponent {
|
||||
public class NodeMappingRefreshAction {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(NodeMappingRefreshAction.class);
|
||||
|
||||
public static final String ACTION_NAME = "internal:cluster/node/mapping/refresh";
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.action.shard;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
@ -42,7 +43,6 @@ import org.elasticsearch.cluster.routing.allocation.StaleShard;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -74,7 +74,9 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class ShardStateAction extends AbstractComponent {
|
||||
public class ShardStateAction {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ShardStateAction.class);
|
||||
|
||||
public static final String SHARD_STARTED_ACTION_NAME = "internal:cluster/shard/started";
|
||||
public static final String SHARD_FAILED_ACTION_NAME = "internal:cluster/shard/failure";
|
||||
|
@ -51,7 +51,6 @@ import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.ValidationException;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.compress.CompressedXContent;
|
||||
import org.elasticsearch.common.io.PathUtils;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
@ -100,7 +99,7 @@ import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF
|
||||
/**
|
||||
* Service responsible for submitting create index requests
|
||||
*/
|
||||
public class MetaDataCreateIndexService extends AbstractComponent {
|
||||
public class MetaDataCreateIndexService {
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataCreateIndexService.class);
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.metadata;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexClusterStateUpdateRequest;
|
||||
import org.elasticsearch.cluster.AckedClusterStateUpdateTask;
|
||||
@ -31,7 +33,6 @@ import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
@ -47,7 +48,10 @@ import static java.util.stream.Collectors.toSet;
|
||||
/**
|
||||
* Deletes indices.
|
||||
*/
|
||||
public class MetaDataDeleteIndexService extends AbstractComponent {
|
||||
public class MetaDataDeleteIndexService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataDeleteIndexService.class);
|
||||
|
||||
private final Settings settings;
|
||||
private final ClusterService clusterService;
|
||||
|
||||
|
@ -39,7 +39,6 @@ import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.ValidationException;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.index.Index;
|
||||
@ -59,7 +58,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Service responsible for submitting open/close index requests
|
||||
*/
|
||||
public class MetaDataIndexStateService extends AbstractComponent {
|
||||
public class MetaDataIndexStateService {
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataIndexStateService.class);
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
package org.elasticsearch.cluster.metadata;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.CollectionUtil;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.admin.indices.alias.Alias;
|
||||
@ -30,7 +32,6 @@ import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.ValidationException;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
@ -61,7 +62,9 @@ import static org.elasticsearch.indices.cluster.IndicesClusterStateService.Alloc
|
||||
/**
|
||||
* Service responsible for submitting index templates updates
|
||||
*/
|
||||
public class MetaDataIndexTemplateService extends AbstractComponent {
|
||||
public class MetaDataIndexTemplateService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataIndexTemplateService.class);
|
||||
|
||||
private final ClusterService clusterService;
|
||||
private final AliasValidator aliasValidator;
|
||||
|
@ -18,12 +18,13 @@
|
||||
*/
|
||||
package org.elasticsearch.cluster.metadata;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.search.similarities.Similarity;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.common.TriFunction;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
@ -51,7 +52,9 @@ import java.util.function.UnaryOperator;
|
||||
* occurs during cluster upgrade, when dangling indices are imported into the cluster or indices
|
||||
* are restored from a repository.
|
||||
*/
|
||||
public class MetaDataIndexUpgradeService extends AbstractComponent {
|
||||
public class MetaDataIndexUpgradeService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataIndexUpgradeService.class);
|
||||
|
||||
private final Settings settings;
|
||||
private final NamedXContentRegistry xContentRegistry;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.metadata;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.core.internal.io.IOUtils;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -32,7 +34,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.compress.CompressedXContent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
@ -57,7 +58,9 @@ import static org.elasticsearch.indices.cluster.IndicesClusterStateService.Alloc
|
||||
/**
|
||||
* Service responsible for submitting mapping changes
|
||||
*/
|
||||
public class MetaDataMappingService extends AbstractComponent {
|
||||
public class MetaDataMappingService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataMappingService.class);
|
||||
|
||||
private final ClusterService clusterService;
|
||||
private final IndicesService indicesService;
|
||||
|
@ -37,7 +37,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.ValidationException;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
@ -62,7 +61,7 @@ import static org.elasticsearch.index.IndexSettings.same;
|
||||
/**
|
||||
* Service responsible for submitting update index settings requests
|
||||
*/
|
||||
public class MetaDataUpdateSettingsService extends AbstractComponent {
|
||||
public class MetaDataUpdateSettingsService {
|
||||
private static final Logger logger = LogManager.getLogger(MetaDataUpdateSettingsService.class);
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.cluster.metadata;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -34,7 +36,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -61,7 +62,10 @@ import static java.util.Collections.singletonMap;
|
||||
/**
|
||||
* Upgrades Templates on behalf of installed {@link Plugin}s when a node joins the cluster
|
||||
*/
|
||||
public class TemplateUpgradeService extends AbstractComponent implements ClusterStateListener {
|
||||
public class TemplateUpgradeService implements ClusterStateListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TemplateUpgradeService.class);
|
||||
|
||||
private final UnaryOperator<Map<String, IndexTemplateMetaData>> indexTemplateMetaDataUpgraders;
|
||||
|
||||
public final ClusterService clusterService;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
@ -26,7 +28,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AwarenessAllocationDecider;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -44,7 +45,9 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class OperationRouting extends AbstractComponent {
|
||||
public class OperationRouting {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(OperationRouting.class);
|
||||
|
||||
public static final Setting<Boolean> USE_ADAPTIVE_REPLICA_SELECTION_SETTING =
|
||||
Setting.boolSetting("cluster.routing.use_adaptive_replica_selection", true,
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.cluster.ClusterInfoService;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -38,7 +40,6 @@ import org.elasticsearch.cluster.routing.allocation.allocator.ShardsAllocator;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.gateway.GatewayAllocator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -61,7 +62,9 @@ import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NOD
|
||||
* for shard allocation. This class also manages new nodes joining the cluster
|
||||
* and rerouting of shards.
|
||||
*/
|
||||
public class AllocationService extends AbstractComponent {
|
||||
public class AllocationService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(AllocationService.class);
|
||||
|
||||
private final AllocationDeciders allocationDeciders;
|
||||
private GatewayAllocator gatewayAllocator;
|
||||
|
@ -25,6 +25,8 @@ import java.util.function.Supplier;
|
||||
|
||||
import com.carrotsearch.hppc.ObjectLookupContainer;
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -35,7 +37,6 @@ import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
@ -45,7 +46,10 @@ import org.elasticsearch.common.util.set.Sets;
|
||||
* reroute if it does. Also responsible for logging about nodes that have
|
||||
* passed the disk watermarks
|
||||
*/
|
||||
public class DiskThresholdMonitor extends AbstractComponent {
|
||||
public class DiskThresholdMonitor {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(DiskThresholdMonitor.class);
|
||||
|
||||
private final DiskThresholdSettings diskThresholdSettings;
|
||||
private final Client client;
|
||||
private final Set<String> nodeHasPassedWatermark = Sets.newConcurrentHashSet();
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation.allocator;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.ArrayUtil;
|
||||
import org.apache.lucene.util.IntroSorter;
|
||||
@ -40,7 +41,6 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.Decision.Type;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.DiskThresholdDecider;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
@ -77,7 +77,9 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.RELOCATING;
|
||||
* These parameters are combined in a {@link WeightFunction} that allows calculation of node weights which
|
||||
* are used to re-balance shards based on global as well as per-index factors.
|
||||
*/
|
||||
public class BalancedShardsAllocator extends AbstractComponent implements ShardsAllocator {
|
||||
public class BalancedShardsAllocator implements ShardsAllocator {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(BalancedShardsAllocator.class);
|
||||
|
||||
public static final Setting<Float> INDEX_BALANCE_FACTOR_SETTING =
|
||||
Setting.floatSetting("cluster.routing.allocation.balance.index", 0.55f, 0.0f, Property.Dynamic, Property.NodeScope);
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
@ -31,7 +30,7 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision.Type;
|
||||
* dynamic cluster- or index-wide shard allocation decisions on a per-node
|
||||
* basis.
|
||||
*/
|
||||
public abstract class AllocationDecider extends AbstractComponent {
|
||||
public abstract class AllocationDecider {
|
||||
/**
|
||||
* Returns a {@link Decision} whether the given shard routing can be
|
||||
* re-balanced to the given allocation. The default is
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
@ -35,6 +37,8 @@ import static org.elasticsearch.cluster.routing.allocation.RoutingAllocation.Deb
|
||||
*/
|
||||
public class AllocationDeciders extends AllocationDecider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(AllocationDeciders.class);
|
||||
|
||||
private final Collection<AllocationDecider> allocations;
|
||||
|
||||
public AllocationDeciders(Collection<AllocationDecider> allocations) {
|
||||
|
@ -21,6 +21,8 @@ package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
@ -47,6 +49,8 @@ import org.elasticsearch.common.settings.Settings;
|
||||
*/
|
||||
public class ClusterRebalanceAllocationDecider extends AllocationDecider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ClusterRebalanceAllocationDecider.class);
|
||||
|
||||
public static final String NAME = "cluster_rebalance";
|
||||
private static final String CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE = "cluster.routing.allocation.allow_rebalance";
|
||||
public static final Setting<ClusterRebalanceType> CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING =
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
@ -40,6 +42,8 @@ import org.elasticsearch.common.settings.Settings;
|
||||
*/
|
||||
public class ConcurrentRebalanceAllocationDecider extends AllocationDecider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ConcurrentRebalanceAllocationDecider.class);
|
||||
|
||||
public static final String NAME = "concurrent_rebalance";
|
||||
|
||||
public static final Setting<Integer> CLUSTER_ROUTING_ALLOCATION_CLUSTER_CONCURRENT_REBALANCE_SETTING =
|
||||
|
4
server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java
4
server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java
@ -22,6 +22,8 @@ package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
import java.util.Set;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
import org.elasticsearch.cluster.DiskUsage;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
@ -68,6 +70,8 @@ import static org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings
|
||||
*/
|
||||
public class DiskThresholdDecider extends AllocationDecider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(DiskThresholdDecider.class);
|
||||
|
||||
public static final String NAME = "disk_threshold";
|
||||
|
||||
private final DiskThresholdSettings diskThresholdSettings;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.SnapshotsInProgress;
|
||||
import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
@ -30,6 +32,8 @@ import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||
*/
|
||||
public class SnapshotInProgressAllocationDecider extends AllocationDecider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(SnapshotInProgressAllocationDecider.class);
|
||||
|
||||
public static final String NAME = "snapshot_in_progress";
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.routing.RecoverySource;
|
||||
import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
@ -52,6 +54,8 @@ import static org.elasticsearch.cluster.routing.allocation.decider.Decision.YES;
|
||||
*/
|
||||
public class ThrottlingAllocationDecider extends AllocationDecider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ThrottlingAllocationDecider.class);
|
||||
|
||||
public static final int DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES = 2;
|
||||
public static final int DEFAULT_CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES = 4;
|
||||
public static final String NAME = "throttling";
|
||||
|
@ -24,7 +24,6 @@ import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.common.blobstore.BlobContainer;
|
||||
import org.elasticsearch.common.blobstore.BlobPath;
|
||||
import org.elasticsearch.common.blobstore.BlobStore;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
@ -33,7 +32,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class FsBlobStore extends AbstractComponent implements BlobStore {
|
||||
public class FsBlobStore implements BlobStore {
|
||||
|
||||
private final Path path;
|
||||
|
||||
|
@ -19,12 +19,13 @@
|
||||
|
||||
package org.elasticsearch.common.settings;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.search.spell.LevenshteinDistance;
|
||||
import org.apache.lucene.util.CollectionUtil;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -47,12 +48,15 @@ import java.util.stream.Collectors;
|
||||
* A basic setting service that can be used for per-index and per-cluster settings.
|
||||
* This service offers transactional application of updates settings.
|
||||
*/
|
||||
public abstract class AbstractScopedSettings extends AbstractComponent {
|
||||
public abstract class AbstractScopedSettings {
|
||||
|
||||
public static final String ARCHIVED_SETTINGS_PREFIX = "archived.";
|
||||
private static final Pattern KEY_PATTERN = Pattern.compile("^(?:[-\\w]+[.])*[-\\w]+$");
|
||||
private static final Pattern GROUP_KEY_PATTERN = Pattern.compile("^(?:[-\\w]+[.])+$");
|
||||
private static final Pattern AFFIX_KEY_PATTERN = Pattern.compile("^(?:[-\\w]+[.])+[*](?:[.][-\\w]+)+$");
|
||||
|
||||
protected final Logger logger = LogManager.getLogger(this.getClass());
|
||||
|
||||
private final Settings settings;
|
||||
private final List<SettingUpdater<?>> settingUpdaters = new CopyOnWriteArrayList<>();
|
||||
private final Map<String, Setting<?>> complexMatchers;
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
package org.elasticsearch.common.util;
|
||||
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.lease.Releasable;
|
||||
import org.elasticsearch.common.lease.Releasables;
|
||||
import org.elasticsearch.common.recycler.AbstractRecyclerC;
|
||||
@ -39,7 +38,7 @@ import static org.elasticsearch.common.recycler.Recyclers.dequeFactory;
|
||||
import static org.elasticsearch.common.recycler.Recyclers.none;
|
||||
|
||||
/** A recycler of fixed-size pages. */
|
||||
public class PageCacheRecycler extends AbstractComponent implements Releasable {
|
||||
public class PageCacheRecycler implements Releasable {
|
||||
|
||||
public static final Setting<Type> TYPE_SETTING =
|
||||
new Setting<>("cache.recycler.page.type", Type.CONCURRENT.name(), Type::parse, Property.NodeScope);
|
||||
|
@ -21,7 +21,6 @@ package org.elasticsearch.discovery;
|
||||
|
||||
import org.elasticsearch.cluster.block.ClusterBlock;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -34,7 +33,7 @@ import java.util.EnumSet;
|
||||
/**
|
||||
* Exposes common discovery settings that may be supported by all the different discovery implementations
|
||||
*/
|
||||
public class DiscoverySettings extends AbstractComponent {
|
||||
public class DiscoverySettings {
|
||||
|
||||
public static final int NO_MASTER_BLOCK_ID = 2;
|
||||
public static final ClusterBlock NO_MASTER_BLOCK_ALL = new ClusterBlock(NO_MASTER_BLOCK_ID, "no master", true, true, false,
|
||||
|
@ -20,10 +20,11 @@
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import com.carrotsearch.hppc.ObjectContainer;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.CollectionUtil;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -37,7 +38,9 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ElectMasterService extends AbstractComponent {
|
||||
public class ElectMasterService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ElectMasterService.class);
|
||||
|
||||
public static final Setting<Integer> DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING =
|
||||
Setting.intSetting("discovery.zen.minimum_master_nodes", -1, Property.Dynamic, Property.NodeScope);
|
||||
|
@ -21,9 +21,10 @@ package org.elasticsearch.discovery.zen;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -39,7 +40,9 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
|
||||
* A base class for {@link MasterFaultDetection} & {@link NodesFaultDetection},
|
||||
* making sure both use the same setting.
|
||||
*/
|
||||
public abstract class FaultDetection extends AbstractComponent implements Closeable {
|
||||
public abstract class FaultDetection implements Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(FaultDetection.class);
|
||||
|
||||
public static final Setting<Boolean> CONNECT_ON_NETWORK_DISCONNECT_SETTING =
|
||||
Setting.boolSetting("discovery.zen.fd.connect_on_network_disconnect", false, Property.NodeScope);
|
||||
|
@ -19,8 +19,9 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -43,7 +44,9 @@ import java.util.stream.Stream;
|
||||
* 67.81.244.11:9305
|
||||
* 67.81.244.15:9400
|
||||
*/
|
||||
public class FileBasedUnicastHostsProvider extends AbstractComponent implements UnicastHostsProvider {
|
||||
public class FileBasedUnicastHostsProvider implements UnicastHostsProvider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(FileBasedUnicastHostsProvider.class);
|
||||
|
||||
public static final String UNICAST_HOSTS_FILE = "unicast_hosts.txt";
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
@ -55,6 +57,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
*/
|
||||
public class MasterFaultDetection extends FaultDetection {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MasterFaultDetection.class);
|
||||
|
||||
public static final String MASTER_PING_ACTION_NAME = "internal:discovery/zen/fd/master_ping";
|
||||
|
||||
public interface Listener {
|
||||
|
@ -19,13 +19,14 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
@ -44,7 +45,9 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class MembershipAction extends AbstractComponent {
|
||||
public class MembershipAction {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MembershipAction.class);
|
||||
|
||||
public static final String DISCOVERY_JOIN_ACTION_NAME = "internal:discovery/zen/join";
|
||||
public static final String DISCOVERY_JOIN_VALIDATE_ACTION_NAME = "internal:discovery/zen/join/validate";
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.store.AlreadyClosedException;
|
||||
@ -34,7 +35,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.MasterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.discovery.DiscoverySettings;
|
||||
@ -54,7 +54,9 @@ import static org.elasticsearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK
|
||||
* This class processes incoming join request (passed zia {@link ZenDiscovery}). Incoming nodes
|
||||
* are directly added to the cluster state or are accumulated during master election.
|
||||
*/
|
||||
public class NodeJoinController extends AbstractComponent {
|
||||
public class NodeJoinController {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(NodeJoinController.class);
|
||||
|
||||
private final MasterService masterService;
|
||||
private final JoinTaskExecutor joinTaskExecutor;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -54,6 +56,8 @@ import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.new
|
||||
*/
|
||||
public class NodesFaultDetection extends FaultDetection {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(NodesFaultDetection.class);
|
||||
|
||||
public static final String PING_ACTION_NAME = "internal:discovery/zen/fd/ping";
|
||||
|
||||
public abstract static class Listener {
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.Version;
|
||||
@ -30,7 +32,6 @@ import org.elasticsearch.cluster.IncompatibleClusterStateVersionException;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.compress.Compressor;
|
||||
import org.elasticsearch.common.compress.CompressorFactory;
|
||||
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||
@ -67,7 +68,9 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
public class PublishClusterStateAction extends AbstractComponent {
|
||||
public class PublishClusterStateAction {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PublishClusterStateAction.class);
|
||||
|
||||
public static final String SEND_ACTION_NAME = "internal:discovery/zen/publish/send";
|
||||
public static final String COMMIT_ACTION_NAME = "internal:discovery/zen/publish/commit";
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
@ -38,7 +39,9 @@ import static java.util.Collections.emptyList;
|
||||
* An example unicast hosts setting might look as follows:
|
||||
* [67.81.244.10, 67.81.244.11:9305, 67.81.244.15:9400]
|
||||
*/
|
||||
public class SettingsBasedHostsProvider extends AbstractComponent implements UnicastHostsProvider {
|
||||
public class SettingsBasedHostsProvider implements UnicastHostsProvider {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(SettingsBasedHostsProvider.class);
|
||||
|
||||
public static final Setting<List<String>> DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING =
|
||||
Setting.listSetting("discovery.zen.ping.unicast.hosts", emptyList(), Function.identity(), Setting.Property.NodeScope);
|
||||
|
@ -20,6 +20,7 @@
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.store.AlreadyClosedException;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.lease.Releasable;
|
||||
@ -91,7 +91,9 @@ import static java.util.Collections.emptyMap;
|
||||
import static java.util.Collections.emptySet;
|
||||
import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.newConcurrentMap;
|
||||
|
||||
public class UnicastZenPing extends AbstractComponent implements ZenPing {
|
||||
public class UnicastZenPing implements ZenPing {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(UnicastZenPing.class);
|
||||
|
||||
public static final String ACTION_NAME = "internal:discovery/zen/unicast";
|
||||
public static final Setting<Integer> DISCOVERY_ZEN_PING_UNICAST_CONCURRENT_CONNECTS_SETTING =
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.routing.allocation.AllocationDecision;
|
||||
import org.elasticsearch.cluster.routing.allocation.NodeAllocationResult;
|
||||
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.Decision;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -40,7 +40,10 @@ import java.util.List;
|
||||
* Individual implementations of this class are responsible for providing
|
||||
* the logic to determine to which nodes (if any) those shards are allocated.
|
||||
*/
|
||||
public abstract class BaseGatewayShardAllocator extends AbstractComponent {
|
||||
public abstract class BaseGatewayShardAllocator {
|
||||
|
||||
protected final Logger logger = LogManager.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
* Allocate unassigned shards to nodes (if any) where valid copies of the shard already exist.
|
||||
* It is up to the individual implementations of {@link #makeAllocationDecision(ShardRouting, RoutingAllocation, Logger)}
|
||||
|
@ -20,13 +20,14 @@
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.ClusterChangedEvent;
|
||||
import org.elasticsearch.cluster.ClusterStateListener;
|
||||
import org.elasticsearch.cluster.metadata.IndexGraveyard;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
@ -50,7 +51,9 @@ import static java.util.Collections.unmodifiableMap;
|
||||
* their state written on disk, but don't exists in the metadata of the cluster), and importing
|
||||
* them into the cluster.
|
||||
*/
|
||||
public class DanglingIndicesState extends AbstractComponent implements ClusterStateListener {
|
||||
public class DanglingIndicesState implements ClusterStateListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(DanglingIndicesState.class);
|
||||
|
||||
private final NodeEnvironment nodeEnv;
|
||||
private final MetaStateService metaStateService;
|
||||
|
@ -21,13 +21,14 @@ package org.elasticsearch.gateway;
|
||||
|
||||
import com.carrotsearch.hppc.ObjectFloatHashMap;
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.discovery.zen.ElectMasterService;
|
||||
@ -37,7 +38,9 @@ import org.elasticsearch.indices.IndicesService;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
public class Gateway extends AbstractComponent {
|
||||
public class Gateway {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(Gateway.class);
|
||||
|
||||
private final ClusterService clusterService;
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeResponse;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
@ -30,7 +31,6 @@ import org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision;
|
||||
import org.elasticsearch.cluster.routing.allocation.FailedShard;
|
||||
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.lease.Releasables;
|
||||
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
||||
@ -40,7 +40,9 @@ import org.elasticsearch.indices.store.TransportNodesListShardStoreMetaData;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
public class GatewayAllocator extends AbstractComponent {
|
||||
public class GatewayAllocator {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(GatewayAllocator.class);
|
||||
|
||||
private final RoutingService routingService;
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterChangedEvent;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -32,7 +34,6 @@ import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
@ -57,7 +58,9 @@ import java.util.function.UnaryOperator;
|
||||
import static java.util.Collections.emptySet;
|
||||
import static java.util.Collections.unmodifiableSet;
|
||||
|
||||
public class GatewayMetaState extends AbstractComponent implements ClusterStateApplier {
|
||||
public class GatewayMetaState implements ClusterStateApplier {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(GatewayMetaState.class);
|
||||
|
||||
private final NodeEnvironment nodeEnv;
|
||||
private final MetaStateService metaStateService;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -31,7 +33,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -50,7 +51,9 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
public class LocalAllocateDangledIndices extends AbstractComponent {
|
||||
public class LocalAllocateDangledIndices {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(LocalAllocateDangledIndices.class);
|
||||
|
||||
public static final String ACTION_NAME = "internal:gateway/local/allocate_dangled";
|
||||
|
||||
|
@ -19,11 +19,12 @@
|
||||
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.index.Index;
|
||||
@ -36,7 +37,9 @@ import java.util.function.Predicate;
|
||||
/**
|
||||
* Handles writing and loading both {@link MetaData} and {@link IndexMetaData}
|
||||
*/
|
||||
public class MetaStateService extends AbstractComponent {
|
||||
public class MetaStateService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MetaStateService.class);
|
||||
|
||||
private final NodeEnvironment nodeEnv;
|
||||
private final NamedXContentRegistry namedXContentRegistry;
|
||||
|
@ -19,9 +19,10 @@
|
||||
|
||||
package org.elasticsearch.index;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.engine.Engine;
|
||||
import org.elasticsearch.index.fielddata.IndexFieldData;
|
||||
@ -41,7 +42,9 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public final class IndexWarmer extends AbstractComponent {
|
||||
public final class IndexWarmer {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(IndexWarmer.class);
|
||||
|
||||
private final List<Listener> listeners;
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.elasticsearch.index.shard;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
@ -26,7 +27,6 @@ import org.elasticsearch.action.resync.ResyncReplicationRequest;
|
||||
import org.elasticsearch.action.resync.ResyncReplicationResponse;
|
||||
import org.elasticsearch.action.resync.TransportResyncReplicationAction;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -52,7 +52,9 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
public class PrimaryReplicaSyncer extends AbstractComponent {
|
||||
public class PrimaryReplicaSyncer {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PrimaryReplicaSyncer.class);
|
||||
|
||||
private final TaskManager taskManager;
|
||||
private final SyncAction syncAction;
|
||||
|
@ -19,9 +19,10 @@
|
||||
|
||||
package org.elasticsearch.indices;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.store.AlreadyClosedException;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -48,7 +49,9 @@ import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
public class IndexingMemoryController extends AbstractComponent implements IndexingOperationListener, Closeable {
|
||||
public class IndexingMemoryController implements IndexingOperationListener, Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(IndexingMemoryController.class);
|
||||
|
||||
/** How much heap (% or bytes) we will share across all actively indexing shards on this node (default: 10%). */
|
||||
public static final Setting<ByteSizeValue> INDEX_BUFFER_SIZE_SETTING =
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.indices;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.index.LeafReaderContext;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.BulkScorer;
|
||||
@ -30,7 +32,6 @@ import org.apache.lucene.search.QueryCachingPolicy;
|
||||
import org.apache.lucene.search.Scorer;
|
||||
import org.apache.lucene.search.ScorerSupplier;
|
||||
import org.apache.lucene.search.Weight;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.lucene.ShardCoreKeyMap;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -48,7 +49,9 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class IndicesQueryCache extends AbstractComponent implements QueryCache, Closeable {
|
||||
public class IndicesQueryCache implements QueryCache, Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(IndicesQueryCache.class);
|
||||
|
||||
public static final Setting<ByteSizeValue> INDICES_CACHE_QUERY_SIZE_SETTING =
|
||||
Setting.memorySizeSetting("indices.queries.cache.size", "10%", Property.NodeScope);
|
||||
|
@ -34,7 +34,6 @@ import org.elasticsearch.common.cache.CacheBuilder;
|
||||
import org.elasticsearch.common.cache.CacheLoader;
|
||||
import org.elasticsearch.common.cache.RemovalListener;
|
||||
import org.elasticsearch.common.cache.RemovalNotification;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -65,8 +64,9 @@ import java.util.function.Supplier;
|
||||
* There are still several TODOs left in this class, some easily addressable, some more complex, but the support
|
||||
* is functional.
|
||||
*/
|
||||
public final class IndicesRequestCache extends AbstractComponent implements RemovalListener<IndicesRequestCache.Key,
|
||||
BytesReference>, Closeable {
|
||||
public final class IndicesRequestCache implements RemovalListener<IndicesRequestCache.Key, BytesReference>, Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(IndicesRequestCache.class);
|
||||
|
||||
/**
|
||||
* A setting to enable or disable request caching on an index level. Its dynamic by default
|
||||
@ -79,8 +79,6 @@ public final class IndicesRequestCache extends AbstractComponent implements Remo
|
||||
public static final Setting<TimeValue> INDICES_CACHE_QUERY_EXPIRE =
|
||||
Setting.positiveTimeSetting("indices.requests.cache.expire", new TimeValue(0), Property.NodeScope);
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(IndicesRequestCache.class);
|
||||
|
||||
private final ConcurrentMap<CleanupKey, Boolean> registeredClosedListeners = ConcurrentCollections.newConcurrentMap();
|
||||
private final Set<CleanupKey> keysToClean = ConcurrentCollections.newConcurrentSet();
|
||||
private final ByteSizeValue size;
|
||||
@ -310,7 +308,7 @@ public final class IndicesRequestCache extends AbstractComponent implements Remo
|
||||
CleanupKey cleanupKey = iterator.next();
|
||||
iterator.remove();
|
||||
if (cleanupKey.readerCacheKey == null || cleanupKey.entity.isOpen() == false) {
|
||||
// -1 indicates full cleanup, as does a closed shard
|
||||
// null indicates full cleanup, as does a closed shard
|
||||
currentFullClean.add(cleanupKey.entity.getCacheIdentity());
|
||||
} else {
|
||||
currentKeysToClean.add(cleanupKey);
|
||||
|
@ -18,13 +18,14 @@
|
||||
*/
|
||||
package org.elasticsearch.indices.analysis;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.analysis.hunspell.Dictionary;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.SimpleFSDirectory;
|
||||
import org.elasticsearch.core.internal.io.IOUtils;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.FileSystemUtils;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -74,7 +75,9 @@ import java.util.function.Function;
|
||||
*
|
||||
* @see org.elasticsearch.index.analysis.HunspellTokenFilterFactory
|
||||
*/
|
||||
public class HunspellService extends AbstractComponent {
|
||||
public class HunspellService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(HunspellService.class);
|
||||
|
||||
public static final Setting<Boolean> HUNSPELL_LAZY_LOAD =
|
||||
Setting.boolSetting("indices.analysis.hunspell.dictionary.lazy", Boolean.FALSE, Property.NodeScope);
|
||||
|
7
server/src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java
vendored
7
server/src/main/java/org/elasticsearch/indices/fielddata/cache/IndicesFieldDataCache.java
vendored
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.indices.fielddata.cache;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
@ -31,7 +33,6 @@ import org.elasticsearch.common.cache.Cache;
|
||||
import org.elasticsearch.common.cache.CacheBuilder;
|
||||
import org.elasticsearch.common.cache.RemovalListener;
|
||||
import org.elasticsearch.common.cache.RemovalNotification;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.lease.Releasable;
|
||||
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
@ -50,7 +51,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.ToLongBiFunction;
|
||||
|
||||
public class IndicesFieldDataCache extends AbstractComponent implements RemovalListener<IndicesFieldDataCache.Key, Accountable>, Releasable{
|
||||
public class IndicesFieldDataCache implements RemovalListener<IndicesFieldDataCache.Key, Accountable>, Releasable{
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(IndicesFieldDataCache.class);
|
||||
|
||||
public static final Setting<ByteSizeValue> INDICES_FIELDDATA_CACHE_SIZE_KEY =
|
||||
Setting.memorySizeSetting("indices.fielddata.cache.size", new ByteSizeValue(-1), Property.NodeScope);
|
||||
|
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.indices.flush;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.Version;
|
||||
@ -36,7 +38,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -71,7 +72,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
public class SyncedFlushService extends AbstractComponent implements IndexEventListener {
|
||||
public class SyncedFlushService implements IndexEventListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(SyncedFlushService.class);
|
||||
|
||||
private static final String PRE_SYNCED_FLUSH_ACTION_NAME = "internal:indices/flush/synced/pre";
|
||||
private static final String SYNCED_FLUSH_ACTION_NAME = "internal:indices/flush/synced/sync";
|
||||
|
@ -19,10 +19,11 @@
|
||||
|
||||
package org.elasticsearch.indices.recovery;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.IndexService;
|
||||
@ -48,7 +49,9 @@ import java.util.Set;
|
||||
* The source recovery accepts recovery requests from other peer shards and start the recovery process from this
|
||||
* source shard to the target shard.
|
||||
*/
|
||||
public class PeerRecoverySourceService extends AbstractComponent implements IndexEventListener {
|
||||
public class PeerRecoverySourceService implements IndexEventListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PeerRecoverySourceService.class);
|
||||
|
||||
public static class Actions {
|
||||
public static final String START_RECOVERY = "internal:index/shard/recovery/start_recovery";
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.indices.recovery;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
@ -34,7 +35,6 @@ import org.elasticsearch.cluster.ClusterStateObserver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
@ -79,7 +79,9 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueMillis;
|
||||
* Note, it can be safely assumed that there will only be a single recovery per shard (index+id) and
|
||||
* not several of them (since we don't allocate several shard replicas to the same node).
|
||||
*/
|
||||
public class PeerRecoveryTargetService extends AbstractComponent implements IndexEventListener {
|
||||
public class PeerRecoveryTargetService implements IndexEventListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PeerRecoveryTargetService.class);
|
||||
|
||||
public static class Actions {
|
||||
public static final String FILES_INFO = "internal:index/shard/recovery/filesInfo";
|
||||
|
@ -19,9 +19,10 @@
|
||||
|
||||
package org.elasticsearch.indices.recovery;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.store.RateLimiter;
|
||||
import org.apache.lucene.store.RateLimiter.SimpleRateLimiter;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -30,7 +31,9 @@ import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
|
||||
public class RecoverySettings extends AbstractComponent {
|
||||
public class RecoverySettings {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RecoverySettings.class);
|
||||
|
||||
public static final Setting<ByteSizeValue> INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING =
|
||||
Setting.byteSizeSetting("indices.recovery.max_bytes_per_sec", new ByteSizeValue(40, ByteSizeUnit.MB),
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.indices.store;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.cluster.ClusterChangedEvent;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
@ -34,7 +36,6 @@ import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -70,7 +71,9 @@ import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class IndicesStore extends AbstractComponent implements ClusterStateListener, Closeable {
|
||||
public class IndicesStore implements ClusterStateListener, Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(IndicesStore.class);
|
||||
|
||||
// TODO this class can be foled into either IndicesService and partially into IndicesClusterStateService there is no need for a separate public service
|
||||
public static final Setting<TimeValue> INDICES_STORE_DELETE_SHARD_TIMEOUT =
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.monitor.fs;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.util.Constants;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
@ -26,7 +28,6 @@ import org.elasticsearch.cluster.DiskUsage;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.SuppressForbidden;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.PathUtils;
|
||||
import org.elasticsearch.env.NodeEnvironment;
|
||||
import org.elasticsearch.env.NodeEnvironment.NodePath;
|
||||
@ -40,7 +41,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class FsProbe extends AbstractComponent {
|
||||
public class FsProbe {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(FsProbe.class);
|
||||
|
||||
private final NodeEnvironment nodeEnv;
|
||||
|
||||
|
@ -19,10 +19,10 @@
|
||||
|
||||
package org.elasticsearch.monitor.fs;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -33,7 +33,9 @@ import org.elasticsearch.cluster.ClusterInfoService;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class FsService extends AbstractComponent {
|
||||
public class FsService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(FsService.class);
|
||||
|
||||
private final FsProbe probe;
|
||||
private final TimeValue refreshInterval;
|
||||
|
@ -19,13 +19,16 @@
|
||||
|
||||
package org.elasticsearch.monitor.jvm;
|
||||
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
|
||||
public class JvmService extends AbstractComponent {
|
||||
public class JvmService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(JvmService.class);
|
||||
|
||||
private final JvmInfo jvmInfo;
|
||||
|
||||
|
@ -19,7 +19,8 @@
|
||||
|
||||
package org.elasticsearch.monitor.os;
|
||||
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -29,7 +30,9 @@ import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class OsService extends AbstractComponent {
|
||||
public class OsService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(OsService.class);
|
||||
|
||||
private final OsProbe probe;
|
||||
private final OsInfo info;
|
||||
|
@ -19,14 +19,17 @@
|
||||
|
||||
package org.elasticsearch.monitor.process;
|
||||
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.util.SingleObjectCache;
|
||||
|
||||
public final class ProcessService extends AbstractComponent {
|
||||
public final class ProcessService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ProcessService.class);
|
||||
|
||||
private final ProcessProbe probe;
|
||||
private final ProcessInfo info;
|
||||
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
|
||||
import org.elasticsearch.action.search.SearchTransportService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.settings.SettingsFilter;
|
||||
import org.elasticsearch.discovery.Discovery;
|
||||
@ -45,7 +44,7 @@ import org.elasticsearch.transport.TransportService;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
||||
public class NodeService extends AbstractComponent implements Closeable {
|
||||
public class NodeService implements Closeable {
|
||||
private final Settings settings;
|
||||
private final ThreadPool threadPool;
|
||||
private final MonitorService monitorService;
|
||||
|
@ -24,7 +24,6 @@ import org.elasticsearch.cluster.ClusterStateListener;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.ExponentiallyWeightedMovingAverage;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
@ -42,7 +41,7 @@ import java.util.concurrent.ConcurrentMap;
|
||||
* tasks executed on each node, making the EWMA of the values available to the
|
||||
* coordinating node.
|
||||
*/
|
||||
public final class ResponseCollectorService extends AbstractComponent implements ClusterStateListener {
|
||||
public final class ResponseCollectorService implements ClusterStateListener {
|
||||
|
||||
private static final double ALPHA = 0.3;
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.persistent;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ResourceAlreadyExistsException;
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -29,7 +31,6 @@ import org.elasticsearch.cluster.ClusterStateUpdateTask;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData.Assignment;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData.PersistentTask;
|
||||
@ -41,7 +42,9 @@ import java.util.Objects;
|
||||
/**
|
||||
* Component that runs only on the master node and is responsible for assigning running tasks to nodes
|
||||
*/
|
||||
public class PersistentTasksClusterService extends AbstractComponent implements ClusterStateListener {
|
||||
public class PersistentTasksClusterService implements ClusterStateListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PersistentTasksClusterService.class);
|
||||
|
||||
private final ClusterService clusterService;
|
||||
private final PersistentTasksExecutorRegistry registry;
|
||||
|
@ -22,7 +22,6 @@ package org.elasticsearch.persistent;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData.Assignment;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData.PersistentTask;
|
||||
import org.elasticsearch.tasks.TaskId;
|
||||
@ -34,7 +33,7 @@ import java.util.function.Predicate;
|
||||
* An executor of tasks that can survive restart of requesting or executing node.
|
||||
* These tasks are using cluster state rather than only transport service to send requests and responses.
|
||||
*/
|
||||
public abstract class PersistentTasksExecutor<Params extends PersistentTaskParams> extends AbstractComponent {
|
||||
public abstract class PersistentTasksExecutor<Params extends PersistentTaskParams> {
|
||||
|
||||
private final String executor;
|
||||
private final String taskName;
|
||||
|
@ -18,13 +18,14 @@
|
||||
*/
|
||||
package org.elasticsearch.persistent;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksResponse;
|
||||
import org.elasticsearch.cluster.ClusterChangedEvent;
|
||||
import org.elasticsearch.cluster.ClusterStateListener;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
@ -48,7 +49,9 @@ import static java.util.Objects.requireNonNull;
|
||||
* This component is responsible for coordination of execution of persistent tasks on individual nodes. It runs on all
|
||||
* non-transport client nodes in the cluster and monitors cluster state changes to detect started commands.
|
||||
*/
|
||||
public class PersistentTasksNodeService extends AbstractComponent implements ClusterStateListener {
|
||||
public class PersistentTasksNodeService implements ClusterStateListener {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PersistentTasksNodeService.class);
|
||||
|
||||
private final Map<Long, AllocatedPersistentTask> runningTasks = new HashMap<>();
|
||||
private final PersistentTasksService persistentTasksService;
|
||||
|
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.persistent;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.Action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
@ -29,7 +31,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.ClusterStateObserver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.node.NodeClosedException;
|
||||
@ -45,7 +46,9 @@ import java.util.function.Supplier;
|
||||
* to the master node so that the master can update the cluster state and can track of the states
|
||||
* of the persistent tasks.
|
||||
*/
|
||||
public class PersistentTasksService extends AbstractComponent {
|
||||
public class PersistentTasksService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PersistentTasksService.class);
|
||||
|
||||
private static final String ACTION_ORIGIN_TRANSIENT_NAME = "action.origin";
|
||||
private static final String PERSISTENT_TASK_ORIGIN = "persistent_tasks";
|
||||
|
@ -33,7 +33,6 @@ import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
|
||||
import org.elasticsearch.bootstrap.JarHell;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.component.LifecycleComponent;
|
||||
import org.elasticsearch.common.inject.Module;
|
||||
import org.elasticsearch.common.io.FileSystemUtils;
|
||||
@ -70,7 +69,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static org.elasticsearch.common.io.FileSystemUtils.isAccessibleDirectory;
|
||||
|
||||
public class PluginsService extends AbstractComponent {
|
||||
public class PluginsService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PluginsService.class);
|
||||
|
||||
private final Settings settings;
|
||||
private final Path configPath;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.repositories;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.cluster.AckedClusterStateUpdateTask;
|
||||
@ -32,7 +34,6 @@ import org.elasticsearch.cluster.metadata.RepositoriesMetaData;
|
||||
import org.elasticsearch.cluster.metadata.RepositoryMetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -53,7 +54,9 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* Service responsible for maintaining and providing access to snapshot repositories on nodes.
|
||||
*/
|
||||
public class RepositoriesService extends AbstractComponent implements ClusterStateApplier {
|
||||
public class RepositoriesService implements ClusterStateApplier {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RepositoriesService.class);
|
||||
|
||||
private final Map<String, Repository.Factory> typesRegistry;
|
||||
|
||||
|
@ -21,12 +21,13 @@ package org.elasticsearch.repositories;
|
||||
|
||||
import com.carrotsearch.hppc.ObjectContainer;
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.repositories.RepositoriesService.VerifyResponse;
|
||||
@ -46,7 +47,10 @@ import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class VerifyNodeRepositoryAction extends AbstractComponent {
|
||||
public class VerifyNodeRepositoryAction {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(VerifyNodeRepositoryAction.class);
|
||||
|
||||
public static final String ACTION_NAME = "internal:admin/repository/verify";
|
||||
|
||||
private final TransportService transportService;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.rest;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
@ -26,7 +28,6 @@ import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.path.PathTrie;
|
||||
@ -60,7 +61,9 @@ import static org.elasticsearch.rest.RestStatus.NOT_ACCEPTABLE;
|
||||
import static org.elasticsearch.rest.RestStatus.OK;
|
||||
import static org.elasticsearch.rest.BytesRestResponse.TEXT_CONTENT_TYPE;
|
||||
|
||||
public class RestController extends AbstractComponent implements HttpServerTransport.Dispatcher {
|
||||
public class RestController implements HttpServerTransport.Dispatcher {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RestController.class);
|
||||
|
||||
private final PathTrie<MethodHandlers> handlers = new PathTrie<>(RestUtils.REST_DECODER);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.script;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
|
||||
@ -39,7 +41,6 @@ import org.elasticsearch.common.cache.CacheBuilder;
|
||||
import org.elasticsearch.common.cache.RemovalListener;
|
||||
import org.elasticsearch.common.cache.RemovalNotification;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
@ -58,7 +59,9 @@ import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ScriptService extends AbstractComponent implements Closeable, ClusterStateApplier {
|
||||
public class ScriptService implements Closeable, ClusterStateApplier {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ScriptService.class);
|
||||
|
||||
static final String DISABLE_DYNAMIC_SCRIPTING_SETTING = "script.disable_dynamic";
|
||||
|
||||
|
@ -22,6 +22,7 @@ import com.carrotsearch.hppc.IntHashSet;
|
||||
import com.carrotsearch.hppc.IntSet;
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.Version;
|
||||
@ -56,7 +57,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.lucene.Lucene;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
@ -115,7 +115,9 @@ import static org.elasticsearch.snapshots.SnapshotUtils.filterIndices;
|
||||
* which removes {@link RestoreInProgress} when all shards are completed. In case of
|
||||
* restore failure a normal recovery fail-over process kicks in.
|
||||
*/
|
||||
public class RestoreService extends AbstractComponent implements ClusterStateApplier {
|
||||
public class RestoreService implements ClusterStateApplier {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RestoreService.class);
|
||||
|
||||
private static final Set<String> UNMODIFIABLE_SETTINGS = unmodifiableSet(newHashSet(
|
||||
SETTING_NUMBER_OF_SHARDS,
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.tasks;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
||||
@ -29,7 +31,6 @@ import org.elasticsearch.cluster.ClusterChangedEvent;
|
||||
import org.elasticsearch.cluster.ClusterStateApplier;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
@ -56,7 +57,10 @@ import static org.elasticsearch.http.HttpTransportSettings.SETTING_HTTP_MAX_HEAD
|
||||
/**
|
||||
* Task Manager service for keeping track of currently running tasks on the nodes
|
||||
*/
|
||||
public class TaskManager extends AbstractComponent implements ClusterStateApplier {
|
||||
public class TaskManager implements ClusterStateApplier {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TaskManager.class);
|
||||
|
||||
private static final TimeValue WAIT_FOR_COMPLETION_POLL = timeValueMillis(100);
|
||||
|
||||
/** Rest headers that are copied to the task */
|
||||
|
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.tasks;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
@ -34,7 +36,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MappingMetaData;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -52,7 +53,9 @@ import java.util.Map;
|
||||
/**
|
||||
* Service that can store task results.
|
||||
*/
|
||||
public class TaskResultsService extends AbstractComponent {
|
||||
public class TaskResultsService {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TaskResultsService.class);
|
||||
|
||||
public static final String TASK_INDEX = ".tasks";
|
||||
|
||||
|
@ -19,11 +19,12 @@
|
||||
|
||||
package org.elasticsearch.threadpool;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.util.Counter;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
@ -61,7 +62,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Collections.unmodifiableMap;
|
||||
|
||||
public class ThreadPool extends AbstractComponent implements Scheduler, Closeable {
|
||||
public class ThreadPool implements Scheduler, Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ThreadPool.class);
|
||||
|
||||
public static class Names {
|
||||
public static final String SAME = "same";
|
||||
|
@ -25,7 +25,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.SettingUpgrader;
|
||||
@ -54,7 +53,7 @@ import java.util.stream.Stream;
|
||||
/**
|
||||
* Base class for all services and components that need up-to-date information about the registered remote clusters
|
||||
*/
|
||||
public abstract class RemoteClusterAware extends AbstractComponent {
|
||||
public abstract class RemoteClusterAware {
|
||||
|
||||
static {
|
||||
// remove search.remote.* settings in 8.0.0
|
||||
|
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.transport;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.lucene.store.AlreadyClosedException;
|
||||
import org.apache.lucene.util.SetOnce;
|
||||
@ -33,7 +35,6 @@ import org.elasticsearch.action.support.ContextPreservingActionListener;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
@ -81,7 +82,9 @@ import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_CO
|
||||
* {@link RemoteClusterService#REMOTE_CONNECTIONS_PER_CLUSTER} until either all eligible nodes are exhausted or the maximum number of
|
||||
* connections per cluster has been reached.
|
||||
*/
|
||||
final class RemoteClusterConnection extends AbstractComponent implements TransportConnectionListener, Closeable {
|
||||
final class RemoteClusterConnection implements TransportConnectionListener, Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RemoteClusterConnection.class);
|
||||
|
||||
private final TransportService transportService;
|
||||
private final ConnectionManager connectionManager;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.transport;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.OriginalIndices;
|
||||
@ -67,6 +69,8 @@ import static org.elasticsearch.common.settings.Setting.timeSetting;
|
||||
*/
|
||||
public final class RemoteClusterService extends RemoteClusterAware implements Closeable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(RemoteClusterService.class);
|
||||
|
||||
static {
|
||||
// remove search.remote.* settings in 8.0.0
|
||||
assert Version.CURRENT.major < 8;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.discovery.zen;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.Constants;
|
||||
import org.elasticsearch.Version;
|
||||
@ -810,6 +811,8 @@ public class UnicastZenPingTests extends ESTestCase {
|
||||
|
||||
private static class TestUnicastZenPing extends UnicastZenPing {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TestUnicastZenPing.class);
|
||||
|
||||
TestUnicastZenPing(Settings settings, ThreadPool threadPool, NetworkHandle networkHandle,
|
||||
PingContextProvider contextProvider) {
|
||||
super(Settings.builder().put("node.name", networkHandle.node.getName()).put(settings).build(),
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.persistent;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.Action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -291,6 +293,8 @@ public class TestPersistentTasksPlugin extends Plugin implements ActionPlugin, P
|
||||
|
||||
public static class TestPersistentTasksExecutor extends PersistentTasksExecutor<TestParams> {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(TestPersistentTasksExecutor.class);
|
||||
|
||||
public static final String NAME = "cluster:admin/persistent/test";
|
||||
private final ClusterService clusterService;
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
package org.elasticsearch.test.tasks;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.apache.logging.log4j.util.Supplier;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
@ -38,6 +40,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
*/
|
||||
public class MockTaskManager extends TaskManager {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(MockTaskManager.class);
|
||||
|
||||
public static final Setting<Boolean> USE_MOCK_TASK_MANAGER_SETTING =
|
||||
Setting.boolSetting("tests.mock.taskmanager.enabled", false, Property.NodeScope);
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ccr.action;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
|
||||
@ -62,6 +64,8 @@ import static org.elasticsearch.xpack.ccr.action.TransportResumeFollowAction.ext
|
||||
|
||||
public class ShardFollowTasksExecutor extends PersistentTasksExecutor<ShardFollowTask> {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(ShardFollowTasksExecutor.class);
|
||||
|
||||
private final Client client;
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
|
@ -675,6 +675,8 @@ public class TransportOpenJobAction extends TransportMasterNodeAction<OpenJobAct
|
||||
|
||||
public static class OpenJobPersistentTasksExecutor extends PersistentTasksExecutor<OpenJobAction.JobParams> {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(OpenJobPersistentTasksExecutor.class);
|
||||
|
||||
private final AutodetectProcessManager autodetectProcessManager;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user