mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Logging: tests: clean up logging (#34606)
Replace internal deprecated calls to `Loggers.getLogger(Class)` with direct calls to log4j `LogManager.getLogger(Class)`
This commit is contained in:
parent
bd143334d3
commit
185c06bb7f
@ -18,10 +18,10 @@
|
||||
*/
|
||||
package org.elasticsearch.action.search;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.OriginalIndices;
|
||||
import org.elasticsearch.common.Nullable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.search.SearchShardTarget;
|
||||
import org.elasticsearch.search.internal.InternalSearchResponse;
|
||||
import org.elasticsearch.search.internal.ShardSearchTransportRequest;
|
||||
@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
* SearchPhaseContext for tests
|
||||
*/
|
||||
public final class MockSearchPhaseContext implements SearchPhaseContext {
|
||||
private static final Logger logger = Loggers.getLogger(MockSearchPhaseContext.class);
|
||||
private static final Logger logger = LogManager.getLogger(MockSearchPhaseContext.class);
|
||||
public AtomicReference<Throwable> phaseFailure = new AtomicReference<>();
|
||||
final int numShards;
|
||||
final AtomicInteger numSuccess;
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.cluster.allocation;
|
||||
|
||||
import com.carrotsearch.hppc.ObjectIntHashMap;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +30,6 @@ import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AwarenessAllocationDecider;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.discovery.zen.ZenDiscovery;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
@ -43,7 +44,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
@ClusterScope(scope= ESIntegTestCase.Scope.TEST, numDataNodes =0, minNumDataNodes = 2)
|
||||
public class AwarenessAllocationIT extends ESIntegTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(AwarenessAllocationIT.class);
|
||||
private final Logger logger = LogManager.getLogger(AwarenessAllocationIT.class);
|
||||
|
||||
@Override
|
||||
protected int numberOfReplicas() {
|
||||
|
@ -20,6 +20,7 @@
|
||||
package org.elasticsearch.cluster.allocation;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.core.internal.io.IOUtils;
|
||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||
@ -74,7 +75,7 @@ import static org.hamcrest.Matchers.hasSize;
|
||||
|
||||
@ClusterScope(scope = Scope.TEST, numDataNodes = 0)
|
||||
public class ClusterRerouteIT extends ESIntegTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ClusterRerouteIT.class);
|
||||
private final Logger logger = LogManager.getLogger(ClusterRerouteIT.class);
|
||||
|
||||
public void testRerouteWithCommands_disableAllocationSettings() throws Exception {
|
||||
Settings commonSettings = Settings.builder()
|
||||
@ -334,7 +335,7 @@ public class ClusterRerouteIT extends ESIntegTestCase {
|
||||
.put(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 1))
|
||||
.execute().actionGet();
|
||||
|
||||
Logger actionLogger = Loggers.getLogger(TransportClusterRerouteAction.class);
|
||||
Logger actionLogger = LogManager.getLogger(TransportClusterRerouteAction.class);
|
||||
|
||||
MockLogAppender dryRunMockLog = new MockLogAppender();
|
||||
dryRunMockLog.start();
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.cluster.routing.ShardRoutingState;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.FilterAllocationDecider;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
@ -46,7 +46,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
@ClusterScope(scope= Scope.TEST, numDataNodes =0)
|
||||
public class FilteringAllocationIT extends ESIntegTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(FilteringAllocationIT.class);
|
||||
private final Logger logger = LogManager.getLogger(FilteringAllocationIT.class);
|
||||
|
||||
public void testDecommissionNodeNoReplicas() throws Exception {
|
||||
logger.info("--> starting 2 nodes");
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -32,7 +34,6 @@ import org.elasticsearch.cluster.routing.RoutingNode;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.CollectionUtils;
|
||||
import org.hamcrest.Matcher;
|
||||
@ -47,7 +48,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
public class AddIncrementallyTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(AddIncrementallyTests.class);
|
||||
private final Logger logger = LogManager.getLogger(AddIncrementallyTests.class);
|
||||
|
||||
public void testAddNodesAndIndices() {
|
||||
Settings.Builder settings = Settings.builder();
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
@ -44,7 +45,6 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
@ -70,7 +70,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class AllocationCommandsTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(AllocationCommandsTests.class);
|
||||
private final Logger logger = LogManager.getLogger(AllocationCommandsTests.class);
|
||||
|
||||
public void testMoveShardCommand() {
|
||||
AllocationService allocation = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -34,7 +35,6 @@ import org.elasticsearch.cluster.routing.allocation.command.CancelAllocationComm
|
||||
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AwarenessAllocationDecider;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -51,7 +51,7 @@ import static org.hamcrest.Matchers.sameInstance;
|
||||
|
||||
public class AwarenessAllocationTests extends ESAllocationTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(AwarenessAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(AwarenessAllocationTests.class);
|
||||
|
||||
public void testMoveShardOnceNewNodeWithAttributeAdded1() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.ArrayUtil;
|
||||
import org.elasticsearch.Version;
|
||||
@ -38,7 +40,6 @@ import org.elasticsearch.cluster.routing.ShardRoutingState;
|
||||
import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
|
||||
import org.elasticsearch.cluster.routing.allocation.allocator.ShardsAllocator;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.gateway.GatewayAllocator;
|
||||
@ -52,7 +53,7 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED;
|
||||
|
||||
public class BalanceConfigurationTests extends ESAllocationTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(BalanceConfigurationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(BalanceConfigurationTests.class);
|
||||
// TODO maybe we can randomize these numbers somehow
|
||||
final int numberOfNodes = 25;
|
||||
final int numberOfIndices = 12;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -31,7 +32,6 @@ import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.UnassignedInfo;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.test.gateway.TestGatewayAllocator;
|
||||
|
||||
@ -46,7 +46,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
public class ClusterRebalanceRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ClusterRebalanceRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ClusterRebalanceRoutingTests.class);
|
||||
|
||||
public void testAlways() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put(ClusterRebalanceAllocationDecider.CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.getKey(),
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class ConcurrentRebalanceRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ConcurrentRebalanceRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ConcurrentRebalanceRoutingTests.class);
|
||||
|
||||
public void testClusterConcurrentRebalance() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -30,7 +31,6 @@ import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
public class DeadNodesAllocationTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(DeadNodesAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(DeadNodesAllocationTests.class);
|
||||
|
||||
public void testSimpleDeadNodeOnStartedPrimaryShard() {
|
||||
AllocationService allocation = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
public class ElectReplicaAsPrimaryDuringRelocationTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ElectReplicaAsPrimaryDuringRelocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ElectReplicaAsPrimaryDuringRelocationTests.class);
|
||||
|
||||
public void testElectReplicaAsPrimaryDuringRelocation() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
@ -33,7 +34,6 @@ import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.ShardRoutingState;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
public class ExpectedShardSizeAllocationTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ExpectedShardSizeAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ExpectedShardSizeAllocationTests.class);
|
||||
|
||||
public void testInitializingHasExpectedSize() {
|
||||
final long byteSize = randomIntBetween(0, Integer.MAX_VALUE);
|
||||
|
@ -21,6 +21,7 @@ package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteRequest;
|
||||
@ -38,7 +39,6 @@ import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.indices.cluster.ClusterStateChanges;
|
||||
@ -63,7 +63,7 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class FailedNodeRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(FailedNodeRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(FailedNodeRoutingTests.class);
|
||||
|
||||
public void testSimpleFailedNodeTest() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put(ClusterRebalanceAllocationDecider.CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.getKey(),
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -34,7 +36,6 @@ import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands;
|
||||
import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.test.VersionUtils;
|
||||
@ -56,7 +57,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class FailedShardsRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(FailedShardsRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(FailedShardsRoutingTests.class);
|
||||
|
||||
public void testFailedShardPrimaryRelocatingToAndFrom() {
|
||||
AllocationService allocation = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class IndexBalanceTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(IndexBalanceTests.class);
|
||||
private final Logger logger = LogManager.getLogger(IndexBalanceTests.class);
|
||||
|
||||
public void testBalanceAllNodesStarted() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
@ -49,7 +50,6 @@ import org.elasticsearch.cluster.routing.allocation.decider.Decision;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.NodeVersionAllocationDecider;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ReplicaAfterPrimaryActiveAllocationDecider;
|
||||
import org.elasticsearch.common.UUIDs;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
@ -76,7 +76,7 @@ import static org.hamcrest.core.Is.is;
|
||||
|
||||
public class NodeVersionAllocationDeciderTests extends ESAllocationTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(NodeVersionAllocationDeciderTests.class);
|
||||
private final Logger logger = LogManager.getLogger(NodeVersionAllocationDeciderTests.class);
|
||||
|
||||
public void testDoNotAllocateFromPrimary() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,14 +29,13 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class PreferPrimaryAllocationTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(PreferPrimaryAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(PreferPrimaryAllocationTests.class);
|
||||
|
||||
public void testPreferPrimaryAllocationOverReplicas() {
|
||||
logger.info("create an allocation with 1 initial recoveries");
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class PrimaryElectionRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(PrimaryElectionRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(PrimaryElectionRoutingTests.class);
|
||||
|
||||
public void testBackupElectionToPrimaryWhenPrimaryCanBeAllocatedToAnotherNode() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -36,7 +36,7 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class PrimaryNotRelocatedWhileBeingRecoveredTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(PrimaryNotRelocatedWhileBeingRecoveredTests.class);
|
||||
private final Logger logger = LogManager.getLogger(PrimaryNotRelocatedWhileBeingRecoveredTests.class);
|
||||
|
||||
public void testPrimaryNotRelocatedWhileBeingRecoveredFrom() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterInfo;
|
||||
@ -32,7 +33,6 @@ import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -43,7 +43,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class RebalanceAfterActiveTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(RebalanceAfterActiveTests.class);
|
||||
private final Logger logger = LogManager.getLogger(RebalanceAfterActiveTests.class);
|
||||
|
||||
public void testRebalanceOnlyAfterAllShardsAreActive() {
|
||||
final long[] sizes = new long[5];
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -27,7 +28,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.cluster.ESAllocationTestCase;
|
||||
|
||||
@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class ReplicaAllocatedAfterPrimaryTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ReplicaAllocatedAfterPrimaryTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ReplicaAllocatedAfterPrimaryTests.class);
|
||||
|
||||
public void testBackupIsAllocatedAfterPrimary() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -31,7 +32,6 @@ import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.not;
|
||||
|
||||
public class RoutingNodesIntegrityTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(IndexBalanceTests.class);
|
||||
private final Logger logger = LogManager.getLogger(IndexBalanceTests.class);
|
||||
|
||||
public void testBalanceAllNodesStarted() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.support.replication.ClusterStateCreationUtils;
|
||||
@ -39,7 +40,6 @@ import org.elasticsearch.cluster.routing.TestShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.Decision;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.SameShardAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.Index;
|
||||
@ -52,7 +52,7 @@ import static org.elasticsearch.cluster.routing.allocation.RoutingNodesUtils.num
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class SameShardRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(SameShardRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(SameShardRoutingTests.class);
|
||||
|
||||
public void testSameHost() {
|
||||
AllocationService strategy = createAllocationService(
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.cluster.ESAllocationTestCase;
|
||||
|
||||
@ -38,7 +38,7 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.UNASSIGNED;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class ShardVersioningTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ShardVersioningTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ShardVersioningTests.class);
|
||||
|
||||
public void testSimple() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put(ClusterRebalanceAllocationDecider.CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE_SETTING.getKey(),
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -31,7 +32,6 @@ import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.ShardRoutingState;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -41,7 +41,7 @@ import static org.elasticsearch.cluster.routing.allocation.RoutingNodesUtils.num
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class ShardsLimitAllocationTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ShardsLimitAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ShardsLimitAllocationTests.class);
|
||||
|
||||
public void testIndexLevelShardsLimitAllocate() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -31,7 +32,6 @@ import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import java.util.HashSet;
|
||||
@ -50,7 +50,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class SingleShardNoReplicasRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(SingleShardNoReplicasRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(SingleShardNoReplicasRoutingTests.class);
|
||||
|
||||
public void testSingleIndexStartedShard() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class SingleShardOneReplicaRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(SingleShardOneReplicaRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(SingleShardOneReplicaRoutingTests.class);
|
||||
|
||||
public void testSingleIndexFirstStartPrimaryThenBackups() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class TenShardsOneReplicaRoutingTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(TenShardsOneReplicaRoutingTests.class);
|
||||
private final Logger logger = LogManager.getLogger(TenShardsOneReplicaRoutingTests.class);
|
||||
|
||||
public void testSingleIndexFirstStartPrimaryThenBackups() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -21,6 +21,8 @@ package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import com.carrotsearch.hppc.IntHashSet;
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -41,7 +43,6 @@ import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationComman
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.Decision;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider;
|
||||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.Index;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
@ -62,7 +63,7 @@ import static org.elasticsearch.cluster.routing.ShardRoutingState.UNASSIGNED;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class ThrottlingAllocationTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(ThrottlingAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(ThrottlingAllocationTests.class);
|
||||
|
||||
public void testPrimaryRecoveryThrottling() {
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.cluster.routing.allocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingNodes;
|
||||
import org.elasticsearch.cluster.routing.RoutingTable;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.not;
|
||||
import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
public class UpdateNumberOfReplicasTests extends ESAllocationTestCase {
|
||||
private final Logger logger = Loggers.getLogger(UpdateNumberOfReplicasTests.class);
|
||||
private final Logger logger = LogManager.getLogger(UpdateNumberOfReplicasTests.class);
|
||||
|
||||
public void testUpdateNumberOfReplicas() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder().put("cluster.routing.allocation.node_concurrent_recoveries", 10).build());
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.cluster.routing.allocation.decider;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
@ -32,7 +34,6 @@ import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.routing.allocation.AllocationService;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.Allocation;
|
||||
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.Rebalance;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.ClusterSettings;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
|
||||
@ -49,7 +50,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class EnableAllocationTests extends ESAllocationTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(EnableAllocationTests.class);
|
||||
private final Logger logger = LogManager.getLogger(EnableAllocationTests.class);
|
||||
|
||||
public void testClusterEnableNone() {
|
||||
AllocationService strategy = createAllocationService(Settings.builder()
|
||||
|
@ -20,6 +20,7 @@ package org.elasticsearch.common;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.Field.Store;
|
||||
@ -28,7 +29,6 @@ import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.index.IndexWriterConfig;
|
||||
import org.apache.lucene.index.SerialMergeScheduler;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
@ -117,7 +117,7 @@ public class UUIDTests extends ESTestCase {
|
||||
}
|
||||
|
||||
public void testCompression() throws Exception {
|
||||
Logger logger = Loggers.getLogger(UUIDTests.class);
|
||||
Logger logger = LogManager.getLogger(UUIDTests.class);
|
||||
// Low number so that the test runs quickly, but the results are more interesting with larger numbers
|
||||
// of indexed documents
|
||||
assertThat(testCompression(100000, 10000, 3, logger), Matchers.lessThan(14d)); // ~12 in practice
|
||||
|
@ -19,6 +19,8 @@
|
||||
package org.elasticsearch.common.logging;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
@ -49,7 +51,7 @@ public class DeprecationLoggerTests extends ESTestCase {
|
||||
|
||||
private static final RegexMatcher warningValueMatcher = matches(WARNING_HEADER_PATTERN.pattern());
|
||||
|
||||
private final DeprecationLogger logger = new DeprecationLogger(Loggers.getLogger(getClass()));
|
||||
private final DeprecationLogger logger = new DeprecationLogger(LogManager.getLogger(getClass()));
|
||||
|
||||
@Override
|
||||
protected boolean enableWarningsCheck() {
|
||||
|
@ -20,6 +20,7 @@
|
||||
package org.elasticsearch.common.logging;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.core.LogEvent;
|
||||
import org.apache.logging.log4j.core.appender.AbstractAppender;
|
||||
@ -57,7 +58,7 @@ public class LoggersTests extends ESTestCase {
|
||||
public void testParameterizedMessageLambda() throws Exception {
|
||||
final MockAppender appender = new MockAppender("trace_appender");
|
||||
appender.start();
|
||||
final Logger testLogger = Loggers.getLogger(LoggersTests.class);
|
||||
final Logger testLogger = LogManager.getLogger(LoggersTests.class);
|
||||
Loggers.addAppender(testLogger, appender);
|
||||
Loggers.setLevel(testLogger, Level.TRACE);
|
||||
|
||||
|
@ -18,12 +18,12 @@
|
||||
*/
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeResponse;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.threadpool.TestThreadPool;
|
||||
@ -292,7 +292,7 @@ public class AsyncShardFetchTests extends ESTestCase {
|
||||
private AtomicInteger reroute = new AtomicInteger();
|
||||
|
||||
TestFetch(ThreadPool threadPool) {
|
||||
super(Loggers.getLogger(TestFetch.class), "test", new ShardId("test", "_na_", 1), null);
|
||||
super(LogManager.getLogger(TestFetch.class), "test", new ShardId("test", "_na_", 1), null);
|
||||
this.threadPool = threadPool;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.gateway;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.Version;
|
||||
@ -35,7 +36,6 @@ import org.elasticsearch.cluster.metadata.MappingMetaData;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.routing.ShardRoutingState;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
@ -63,7 +63,7 @@ import static org.hamcrest.Matchers.nullValue;
|
||||
@ClusterScope(scope = Scope.TEST, numDataNodes = 0)
|
||||
public class GatewayIndexStateIT extends ESIntegTestCase {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(GatewayIndexStateIT.class);
|
||||
private final Logger logger = LogManager.getLogger(GatewayIndexStateIT.class);
|
||||
|
||||
public void testMappingMetaDataParsed() throws Exception {
|
||||
logger.info("--> starting 1 nodes");
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.indices.state;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.routing.ShardRoutingState;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.IndexNotFoundException;
|
||||
import org.elasticsearch.indices.IndexClosedException;
|
||||
@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.nullValue;
|
||||
|
||||
@ESIntegTestCase.ClusterScope(minNumDataNodes = 2)
|
||||
public class SimpleIndexStateIT extends ESIntegTestCase {
|
||||
private final Logger logger = Loggers.getLogger(SimpleIndexStateIT.class);
|
||||
private final Logger logger = LogManager.getLogger(SimpleIndexStateIT.class);
|
||||
|
||||
public void testSimpleOpenClose() {
|
||||
logger.info("--> creating test index");
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.recovery;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
|
||||
import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.routing.ShardRouting;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
@ -55,7 +55,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTi
|
||||
|
||||
@TestLogging("_root:DEBUG,org.elasticsearch.index.shard:TRACE,org.elasticsearch.cluster.service:TRACE,org.elasticsearch.index.seqno:TRACE,org.elasticsearch.indices.recovery:TRACE")
|
||||
public class RecoveryWhileUnderLoadIT extends ESIntegTestCase {
|
||||
private final Logger logger = Loggers.getLogger(RecoveryWhileUnderLoadIT.class);
|
||||
private final Logger logger = LogManager.getLogger(RecoveryWhileUnderLoadIT.class);
|
||||
|
||||
public void testRecoverWhileUnderLoadAllocateReplicasTest() throws Exception {
|
||||
logger.info("--> creating test index ...");
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.search;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.ActionFuture;
|
||||
import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksResponse;
|
||||
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
|
||||
@ -29,7 +30,6 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.SearchScrollAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
@ -269,7 +269,7 @@ public class SearchCancellationIT extends ESIntegTestCase {
|
||||
public Map<String, Function<Map<String, Object>, Object>> pluginScripts() {
|
||||
return Collections.singletonMap(SCRIPT_NAME, params -> {
|
||||
LeafFieldsLookup fieldsLookup = (LeafFieldsLookup) params.get("_fields");
|
||||
Loggers.getLogger(SearchCancellationIT.class).info("Blocking on the document {}", fieldsLookup.get("_id"));
|
||||
LogManager.getLogger(SearchCancellationIT.class).info("Blocking on the document {}", fieldsLookup.get("_id"));
|
||||
hits.incrementAndGet();
|
||||
try {
|
||||
awaitBusy(() -> shouldBlock.get() == false);
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.search.aggregations.metrics;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.script.Script;
|
||||
@ -81,7 +81,7 @@ public class HDRPercentileRanksIT extends AbstractNumericTestCase {
|
||||
}
|
||||
}
|
||||
Arrays.sort(percents);
|
||||
Loggers.getLogger(HDRPercentileRanksIT.class).info("Using values={}", Arrays.toString(percents));
|
||||
LogManager.getLogger(HDRPercentileRanksIT.class).info("Using values={}", Arrays.toString(percents));
|
||||
return percents;
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.search.aggregations.metrics;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.CollectionUtils;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
@ -82,7 +82,7 @@ public class HDRPercentilesIT extends AbstractNumericTestCase {
|
||||
}
|
||||
}
|
||||
Arrays.sort(percentiles);
|
||||
Loggers.getLogger(HDRPercentilesIT.class).info("Using percentiles={}", Arrays.toString(percentiles));
|
||||
LogManager.getLogger(HDRPercentilesIT.class).info("Using percentiles={}", Arrays.toString(percentiles));
|
||||
return percentiles;
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.search.aggregations.metrics;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.CollectionUtils;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
@ -81,7 +81,7 @@ public class TDigestPercentileRanksIT extends AbstractNumericTestCase {
|
||||
}
|
||||
}
|
||||
Arrays.sort(percents);
|
||||
Loggers.getLogger(TDigestPercentileRanksIT.class).info("Using values={}", Arrays.toString(percents));
|
||||
LogManager.getLogger(TDigestPercentileRanksIT.class).info("Using values={}", Arrays.toString(percents));
|
||||
return percents;
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.search.aggregations.metrics;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.CollectionUtils;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
@ -81,7 +81,7 @@ public class TDigestPercentilesIT extends AbstractNumericTestCase {
|
||||
}
|
||||
}
|
||||
Arrays.sort(percentiles);
|
||||
Loggers.getLogger(TDigestPercentilesIT.class).info("Using percentiles={}", Arrays.toString(percentiles));
|
||||
LogManager.getLogger(TDigestPercentilesIT.class).info("Using percentiles={}", Arrays.toString(percentiles));
|
||||
return percentiles;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
package org.elasticsearch.transport;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction;
|
||||
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest;
|
||||
@ -44,12 +45,12 @@ public class TransportLoggerTests extends ESTestCase {
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
appender = new MockLogAppender();
|
||||
Loggers.addAppender(Loggers.getLogger(TransportLogger.class), appender);
|
||||
Loggers.addAppender(LogManager.getLogger(TransportLogger.class), appender);
|
||||
appender.start();
|
||||
}
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
Loggers.removeAppender(Loggers.getLogger(TransportLogger.class), appender);
|
||||
Loggers.removeAppender(LogManager.getLogger(TransportLogger.class), appender);
|
||||
appender.stop();
|
||||
super.tearDown();
|
||||
}
|
||||
|
@ -21,12 +21,13 @@ package org.elasticsearch.index.store;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.Listeners;
|
||||
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.store.BaseDirectoryTestCase;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.TimeUnits;
|
||||
import org.elasticsearch.bootstrap.BootstrapForTesting;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.test.junit.listeners.ReproduceInfoPrinter;
|
||||
|
||||
/**
|
||||
@ -48,6 +49,6 @@ public abstract class EsBaseDirectoryTestCase extends BaseDirectoryTestCase {
|
||||
BootstrapForTesting.ensureInitialized();
|
||||
}
|
||||
|
||||
protected final Logger logger = Loggers.getLogger(getClass());
|
||||
protected final Logger logger = LogManager.getLogger(getClass());
|
||||
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ package org.elasticsearch.test;/*
|
||||
import com.carrotsearch.randomizedtesting.RandomizedTest;
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
||||
|
||||
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;
|
||||
@ -29,7 +31,6 @@ import org.elasticsearch.action.bulk.BulkRequestBuilder;
|
||||
import org.elasticsearch.action.bulk.BulkResponse;
|
||||
import org.elasticsearch.action.index.IndexResponse;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
@ -50,7 +51,7 @@ import static org.hamcrest.Matchers.equalTo;
|
||||
|
||||
public class BackgroundIndexer implements AutoCloseable {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(getClass());
|
||||
private final Logger logger = LogManager.getLogger(getClass());
|
||||
|
||||
final Thread[] writers;
|
||||
final CountDownLatch stopLatch;
|
||||
|
@ -249,7 +249,7 @@ public abstract class ESTestCase extends LuceneTestCase {
|
||||
System.setProperty("io.netty.leakDetection.level", "paranoid");
|
||||
}
|
||||
|
||||
protected final Logger logger = Loggers.getLogger(getClass());
|
||||
protected final Logger logger = LogManager.getLogger(getClass());
|
||||
private ThreadContext threadContext;
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.test;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.breaker.CircuitBreaker;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
@ -57,7 +57,7 @@ import static org.junit.Assert.assertThat;
|
||||
*/
|
||||
public final class ExternalTestCluster extends TestCluster {
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(ExternalTestCluster.class);
|
||||
private static final Logger logger = LogManager.getLogger(ExternalTestCluster.class);
|
||||
|
||||
private static final AtomicInteger counter = new AtomicInteger();
|
||||
public static final String EXTERNAL_CLUSTER_PREFIX = "external_";
|
||||
|
@ -28,6 +28,7 @@ import com.carrotsearch.randomizedtesting.generators.RandomNumbers;
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomStrings;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.store.AlreadyClosedException;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
@ -57,7 +58,6 @@ import org.elasticsearch.common.component.LifecycleListener;
|
||||
import org.elasticsearch.common.io.FileSystemUtils;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.lease.Releasables;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.network.NetworkModule;
|
||||
import org.elasticsearch.common.settings.MockSecureSettings;
|
||||
import org.elasticsearch.common.settings.SecureSettings;
|
||||
@ -174,7 +174,7 @@ import static org.junit.Assert.fail;
|
||||
*/
|
||||
public final class InternalTestCluster extends TestCluster {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(getClass());
|
||||
private final Logger logger = LogManager.getLogger(getClass());
|
||||
|
||||
public static final int DEFAULT_LOW_NUM_MASTER_NODES = 1;
|
||||
public static final int DEFAULT_HIGH_NUM_MASTER_NODES = 3;
|
||||
|
@ -20,6 +20,8 @@
|
||||
package org.elasticsearch.test;
|
||||
|
||||
import com.carrotsearch.hppc.ObjectArrayList;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
|
||||
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
|
||||
@ -27,7 +29,6 @@ import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.index.IndexNotFoundException;
|
||||
import org.elasticsearch.indices.IndexTemplateMissingException;
|
||||
import org.elasticsearch.repositories.RepositoryMissingException;
|
||||
@ -46,7 +47,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke
|
||||
*/
|
||||
public abstract class TestCluster implements Closeable {
|
||||
|
||||
protected final Logger logger = Loggers.getLogger(getClass());
|
||||
protected final Logger logger = LogManager.getLogger(getClass());
|
||||
private final long seed;
|
||||
|
||||
protected Random random;
|
||||
|
@ -20,11 +20,12 @@
|
||||
package org.elasticsearch.test.disruption;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.generators.RandomPicks;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.NodeConnectionsService;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.util.set.Sets;
|
||||
import org.elasticsearch.test.InternalTestCluster;
|
||||
@ -48,7 +49,7 @@ import static org.junit.Assert.assertFalse;
|
||||
*/
|
||||
public class NetworkDisruption implements ServiceDisruptionScheme {
|
||||
|
||||
private final Logger logger = Loggers.getLogger(NetworkDisruption.class);
|
||||
private final Logger logger = LogManager.getLogger(NetworkDisruption.class);
|
||||
|
||||
private final DisruptedLinks disruptedLinks;
|
||||
private final NetworkLinkDisruptionType networkLinkDisruptionType;
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.test.disruption;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.test.InternalTestCluster;
|
||||
|
||||
import java.util.Random;
|
||||
@ -28,7 +28,7 @@ import static org.junit.Assert.assertFalse;
|
||||
|
||||
public abstract class SingleNodeDisruption implements ServiceDisruptionScheme {
|
||||
|
||||
protected final Logger logger = Loggers.getLogger(getClass());
|
||||
protected final Logger logger = LogManager.getLogger(getClass());
|
||||
|
||||
protected volatile String disruptedNode;
|
||||
protected volatile InternalTestCluster cluster;
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.elasticsearch.test.engine;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.index.AssertingDirectoryReader;
|
||||
import org.apache.lucene.index.DirectoryReader;
|
||||
@ -28,7 +29,6 @@ import org.apache.lucene.search.QueryCache;
|
||||
import org.apache.lucene.search.QueryCachingPolicy;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -66,7 +66,7 @@ public final class MockEngineSupport {
|
||||
|
||||
|
||||
private final AtomicBoolean closing = new AtomicBoolean(false);
|
||||
private final Logger logger = Loggers.getLogger(Engine.class);
|
||||
private final Logger logger = LogManager.getLogger(Engine.class);
|
||||
private final ShardId shardId;
|
||||
private final QueryCache filterCache;
|
||||
private final QueryCachingPolicy filterCachingPolicy;
|
||||
|
@ -19,11 +19,12 @@
|
||||
package org.elasticsearch.test.junit.listeners;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.ReproduceErrorMessageBuilder;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.Constants;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.SuppressForbidden;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.test.ESIntegTestCase;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
|
||||
@ -47,7 +48,7 @@ import static org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.REST_TE
|
||||
*/
|
||||
public class ReproduceInfoPrinter extends RunListener {
|
||||
|
||||
protected final Logger logger = Loggers.getLogger(ESTestCase.class);
|
||||
protected final Logger logger = LogManager.getLogger(ESTestCase.class);
|
||||
|
||||
@Override
|
||||
public void testStarted(Description description) throws Exception {
|
||||
|
@ -19,11 +19,13 @@
|
||||
package org.elasticsearch.test.rest.yaml;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.RandomizedTest;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.client.NodeSelector;
|
||||
@ -34,7 +36,6 @@ import org.elasticsearch.client.ResponseException;
|
||||
import org.elasticsearch.client.RestClient;
|
||||
import org.elasticsearch.client.RestClientBuilder;
|
||||
import org.elasticsearch.common.CheckedSupplier;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestApi;
|
||||
import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestPath;
|
||||
import org.elasticsearch.test.rest.yaml.restspec.ClientYamlSuiteRestSpec;
|
||||
@ -57,7 +58,7 @@ import java.util.stream.Collectors;
|
||||
* REST calls.
|
||||
*/
|
||||
public class ClientYamlTestClient implements Closeable {
|
||||
private static final Logger logger = Loggers.getLogger(ClientYamlTestClient.class);
|
||||
private static final Logger logger = LogManager.getLogger(ClientYamlTestClient.class);
|
||||
|
||||
private static final ContentType YAML_CONTENT_TYPE = ContentType.create("application/yaml");
|
||||
|
||||
|
@ -19,15 +19,16 @@
|
||||
package org.elasticsearch.test.rest.yaml;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.RandomizedTest;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.entity.ByteArrayEntity;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.client.NodeSelector;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
@ -47,7 +48,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class ClientYamlTestExecutionContext {
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(ClientYamlTestExecutionContext.class);
|
||||
private static final Logger logger = LogManager.getLogger(ClientYamlTestExecutionContext.class);
|
||||
|
||||
private static final XContentType[] STREAMING_CONTENT_TYPES = new XContentType[]{XContentType.JSON, XContentType.SMILE};
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
|
||||
package org.elasticsearch.test.rest.yaml;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
||||
@ -42,7 +42,7 @@ public class Stash implements ToXContentFragment {
|
||||
private static final Pattern EXTENDED_KEY = Pattern.compile("\\$\\{([^}]+)\\}");
|
||||
private static final Pattern PATH = Pattern.compile("\\$_path");
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(Stash.class);
|
||||
private static final Logger logger = LogManager.getLogger(Stash.class);
|
||||
|
||||
public static final Stash EMPTY = new Stash();
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -43,7 +43,7 @@ public class ContainsAssertion extends Assertion {
|
||||
return new ContainsAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(ContainsAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(ContainsAssertion.class);
|
||||
|
||||
public ContainsAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.client.HasAttributeNodeSelector;
|
||||
@ -28,7 +29,6 @@ import org.elasticsearch.common.ParsingException;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.DeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
@ -183,7 +183,7 @@ public class DoSection implements ExecutableSection {
|
||||
}
|
||||
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(DoSection.class);
|
||||
private static final Logger logger = LogManager.getLogger(DoSection.class);
|
||||
|
||||
private final XContentLocation location;
|
||||
private String catchParam;
|
||||
|
@ -18,9 +18,9 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -47,7 +47,7 @@ public class GreaterThanAssertion extends Assertion {
|
||||
return new GreaterThanAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(GreaterThanAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(GreaterThanAssertion.class);
|
||||
|
||||
public GreaterThanAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
@ -19,9 +19,9 @@
|
||||
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -48,7 +48,7 @@ public class GreaterThanEqualToAssertion extends Assertion {
|
||||
return new GreaterThanEqualToAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(GreaterThanEqualToAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(GreaterThanEqualToAssertion.class);
|
||||
|
||||
public GreaterThanEqualToAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -41,7 +41,7 @@ public class IsFalseAssertion extends Assertion {
|
||||
return new IsFalseAssertion(parser.getTokenLocation(), ParserUtils.parseField(parser));
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(IsFalseAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(IsFalseAssertion.class);
|
||||
|
||||
public IsFalseAssertion(XContentLocation location, String field) {
|
||||
super(location, field, false);
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -42,7 +42,7 @@ public class IsTrueAssertion extends Assertion {
|
||||
return new IsTrueAssertion(parser.getTokenLocation(), ParserUtils.parseField(parser));
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(IsTrueAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(IsTrueAssertion.class);
|
||||
|
||||
public IsTrueAssertion(XContentLocation location, String field) {
|
||||
super(location, field, true);
|
||||
|
@ -18,9 +18,9 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -55,7 +55,7 @@ public class LengthAssertion extends Assertion {
|
||||
return new LengthAssertion(location, stringObjectTuple.v1(), value);
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(LengthAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(LengthAssertion.class);
|
||||
|
||||
public LengthAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
@ -18,9 +18,9 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -48,7 +48,7 @@ public class LessThanAssertion extends Assertion {
|
||||
return new LessThanAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(LessThanAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(LessThanAssertion.class);
|
||||
|
||||
public LessThanAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
@ -19,9 +19,9 @@
|
||||
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
||||
@ -48,7 +48,7 @@ public class LessThanOrEqualToAssertion extends Assertion {
|
||||
return new LessThanOrEqualToAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(LessThanOrEqualToAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(LessThanOrEqualToAssertion.class);
|
||||
|
||||
public LessThanOrEqualToAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
@ -18,9 +18,9 @@
|
||||
*/
|
||||
package org.elasticsearch.test.rest.yaml.section;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.XContentLocation;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.test.NotEqualMessageBuilder;
|
||||
@ -48,7 +48,7 @@ public class MatchAssertion extends Assertion {
|
||||
return new MatchAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2());
|
||||
}
|
||||
|
||||
private static final Logger logger = Loggers.getLogger(MatchAssertion.class);
|
||||
private static final Logger logger = LogManager.getLogger(MatchAssertion.class);
|
||||
|
||||
public MatchAssertion(XContentLocation location, String field, Object expectedValue) {
|
||||
super(location, field, expectedValue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user