fix checkstyle problems
This commit is contained in:
parent
f9e6163365
commit
947e9ed2c7
|
@ -50,12 +50,12 @@ import org.elasticsearch.test.ESAllocationTestCase;
|
|||
import org.elasticsearch.test.gateway.NoopGatewayAllocator;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.util.Collections.*;
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static java.util.Collections.singleton;
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.INITIALIZING;
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.RELOCATING;
|
||||
import static org.elasticsearch.cluster.routing.ShardRoutingState.STARTED;
|
||||
|
@ -962,9 +962,9 @@ public class DiskThresholdDeciderTests extends ESAllocationTestCase {
|
|||
|
||||
logger.info("--> adding one master node, one data node");
|
||||
DiscoveryNode discoveryNode1 = new DiscoveryNode("", "node1", new LocalTransportAddress("1"), emptyMap(),
|
||||
Collections.singleton(DiscoveryNode.Role.MASTER), Version.CURRENT);
|
||||
singleton(DiscoveryNode.Role.MASTER), Version.CURRENT);
|
||||
DiscoveryNode discoveryNode2 = new DiscoveryNode("", "node2", new LocalTransportAddress("2"), emptyMap(),
|
||||
Collections.singleton(DiscoveryNode.Role.DATA), Version.CURRENT);
|
||||
singleton(DiscoveryNode.Role.DATA), Version.CURRENT);
|
||||
|
||||
DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().put(discoveryNode1).put(discoveryNode2).build();
|
||||
ClusterState baseClusterState = ClusterState.builder(org.elasticsearch.cluster.ClusterName.DEFAULT)
|
||||
|
@ -1030,7 +1030,7 @@ public class DiskThresholdDeciderTests extends ESAllocationTestCase {
|
|||
// Add another datanode, it should relocate.
|
||||
logger.info("--> adding node3");
|
||||
DiscoveryNode discoveryNode3 = new DiscoveryNode("", "node3", new LocalTransportAddress("3"), emptyMap(),
|
||||
Collections.singleton(DiscoveryNode.Role.DATA), Version.CURRENT);
|
||||
singleton(DiscoveryNode.Role.DATA), Version.CURRENT);
|
||||
ClusterState updateClusterState = ClusterState.builder(clusterState).nodes(DiscoveryNodes.builder(clusterState.nodes())
|
||||
.put(discoveryNode3)).build();
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ public class ElectMasterServiceTests extends ESTestCase {
|
|||
if (randomBoolean()) {
|
||||
roles.add(DiscoveryNode.Role.MASTER);
|
||||
}
|
||||
DiscoveryNode node = new DiscoveryNode("n_" + i, "n_" + i, DummyTransportAddress.INSTANCE, Collections.emptyMap(), roles, Version.CURRENT);
|
||||
DiscoveryNode node = new DiscoveryNode("n_" + i, "n_" + i, DummyTransportAddress.INSTANCE, Collections.emptyMap(),
|
||||
roles, Version.CURRENT);
|
||||
nodes.add(node);
|
||||
}
|
||||
|
||||
|
@ -96,6 +97,7 @@ public class ElectMasterServiceTests extends ESTestCase {
|
|||
} else if (min_master_nodes > 0 && master_nodes < min_master_nodes) {
|
||||
assertNull(master);
|
||||
} else {
|
||||
assertNotNull(master);
|
||||
for (DiscoveryNode node : nodes) {
|
||||
if (node.masterNode()) {
|
||||
assertTrue(master.id().compareTo(node.id()) <= 0);
|
||||
|
|
Loading…
Reference in New Issue