diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java index f99b2af4bf3..d5cb049176a 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/action/TransportMonitoringBulkActionTests.java @@ -47,6 +47,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.VersionUtils.randomVersion; import static org.hamcrest.Matchers.containsString; @@ -88,7 +90,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase { clusterService = new ClusterService(Settings.EMPTY, null, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), threadPool, new ClusterName(TransportMonitoringBulkActionTests.class.getName())); - clusterService.setLocalNode(new DiscoveryNode("node", DummyTransportAddress.INSTANCE, Version.CURRENT)); + clusterService.setLocalNode(new DiscoveryNode("node", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); clusterService.setNodeConnectionsService(new NodeConnectionsService(Settings.EMPTY, null, null) { @Override public void connectToAddedNodes(ClusterChangedEvent event) { diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java index 298021e148d..31e4f2df5e3 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/MonitoringDocTests.java @@ -14,6 +14,11 @@ import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.test.ESTestCase; import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import static org.elasticsearch.test.VersionUtils.randomVersion; import static org.hamcrest.Matchers.equalTo; @@ -120,14 +125,15 @@ public class MonitoringDocTests extends ESTestCase { } private DiscoveryNode newRandomDiscoveryNode() { - ImmutableOpenMap.Builder attributes = ImmutableOpenMap.builder(); + Map attributes = new HashMap<>(); if (rarely()) { int nbAttributes = randomIntBetween(0, 5); for (int i = 0; i < nbAttributes; i++) { attributes.put("key#" + i, String.valueOf(i)); } } + Set roles = new HashSet<>(randomSubsetOf(Arrays.asList(DiscoveryNode.Role.values()))); return new DiscoveryNode(randomAsciiOfLength(5), randomAsciiOfLength(3), randomAsciiOfLength(3), randomAsciiOfLength(3), - DummyTransportAddress.INSTANCE, attributes.build(), randomVersion(random())); + DummyTransportAddress.INSTANCE, attributes, roles, randomVersion(random())); } } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java index d96dfea39c2..0ece35ae523 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/http/HttpExporterTests.java @@ -46,6 +46,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils.dataTemplateName; import static org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils.indexTemplateName; @@ -449,14 +451,14 @@ public class HttpExporterTests extends MarvelIntegTestCase { IndexRecoveryMonitoringDoc doc = new IndexRecoveryMonitoringDoc(MonitoredSystem.ES.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(internalCluster().getClusterName()); doc.setTimestamp(System.currentTimeMillis()); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setRecoveryResponse(new RecoveryResponse()); return doc; } else { ClusterStateMonitoringDoc doc = new ClusterStateMonitoringDoc(MonitoredSystem.ES.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(internalCluster().getClusterName()); doc.setTimestamp(System.currentTimeMillis()); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setClusterState(ClusterState.PROTO); doc.setStatus(ClusterHealthStatus.GREEN); return doc; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java index eb97432e3ba..0bdeb52d75a 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporterTests.java @@ -37,6 +37,8 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils.dataTemplateName; import static org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils.indexTemplateName; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; @@ -197,14 +199,14 @@ public class LocalExporterTests extends MarvelIntegTestCase { IndexRecoveryMonitoringDoc doc = new IndexRecoveryMonitoringDoc(MonitoredSystem.ES.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(internalCluster().getClusterName()); doc.setTimestamp(System.currentTimeMillis()); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setRecoveryResponse(new RecoveryResponse()); return doc; } else { ClusterStateMonitoringDoc doc = new ClusterStateMonitoringDoc(MonitoredSystem.ES.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(internalCluster().getClusterName()); doc.setTimestamp(System.currentTimeMillis()); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setClusterState(ClusterState.PROTO); doc.setStatus(ClusterHealthStatus.GREEN); return doc; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java index 240b8fe3b4a..a526dfd20a4 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/DataResolverTests.java @@ -14,6 +14,8 @@ import org.elasticsearch.marvel.agent.exporter.MonitoringDoc; import java.io.IOException; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; public class DataResolverTests extends MonitoringIndexNameResolverTestCase { @@ -30,7 +32,7 @@ public class DataResolverTests extends MonitoringIndexNameResolverTestCase { MonitoringDoc doc = new MonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); return doc; } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/TimestampedResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/TimestampedResolverTests.java index d2ed8a03d6e..3fe211e89db 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/TimestampedResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/TimestampedResolverTests.java @@ -18,6 +18,8 @@ import org.joda.time.format.DateTimeFormat; import java.io.IOException; import java.util.Arrays; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.DELIMITER; import static org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolver.PREFIX; @@ -39,7 +41,8 @@ public class TimestampedResolverTests extends MonitoringIndexNameResolverTestCas MonitoringDoc doc = new MonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode(randomAsciiOfLength(5), DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode(randomAsciiOfLength(5), DummyTransportAddress.INSTANCE, + emptyMap(), emptySet(), Version.CURRENT)); return doc; } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkResolverTests.java index 3ffeb72e4b2..56382cf9824 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/bulk/MonitoringBulkResolverTests.java @@ -12,9 +12,10 @@ import org.elasticsearch.common.transport.DummyTransportAddress; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.marvel.action.MonitoringBulkDoc; -import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -25,7 +26,7 @@ public class MonitoringBulkResolverTests extends MonitoringIndexNameResolverTest MonitoringBulkDoc doc = new MonitoringBulkDoc(MonitoredSystem.KIBANA.getSystem(), Version.CURRENT.toString()); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setType("kibana_stats"); doc.setSource(new BytesArray("{\"field1\" : \"value1\"}")); return doc; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java index 807d342e94a..9d98b85643d 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterInfoResolverTests.java @@ -20,6 +20,8 @@ import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCa import java.util.UUID; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; public class ClusterInfoResolverTests extends MonitoringIndexNameResolverTestCase { @@ -39,7 +41,7 @@ public class ClusterInfoResolverTests extends MonitoringIndexNameResolverTestCas ClusterInfoMonitoringDoc doc = new ClusterInfoMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setVersion(randomFrom(Version.V_2_0_0, Version.CURRENT).toString()); doc.setLicense(licenseBuilder.build()); doc.setClusterName(randomAsciiOfLength(5)); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java index 96313109f1e..a3a10ea24d5 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateNodeResolverTests.java @@ -15,6 +15,8 @@ import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCa import java.util.UUID; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -26,7 +28,7 @@ public class ClusterStateNodeResolverTests extends ClusterStateNodeMonitoringDoc doc = new ClusterStateNodeMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setNodeId(UUID.randomUUID().toString()); doc.setStateUUID(UUID.randomUUID().toString()); return doc; diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java index 94b21d3c307..c7bbe235ac8 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateResolverTests.java @@ -20,6 +20,8 @@ import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCa import java.io.IOException; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -30,11 +32,12 @@ public class ClusterStateResolverTests extends MonitoringIndexNameResolverTestCa ClusterStateMonitoringDoc doc = new ClusterStateMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setStatus(randomFrom(ClusterHealthStatus.values())); - DiscoveryNode masterNode = new DiscoveryNode("master", new LocalTransportAddress("master"), Version.CURRENT); - DiscoveryNode otherNode = new DiscoveryNode("other", new LocalTransportAddress("other"), Version.CURRENT); + DiscoveryNode masterNode = new DiscoveryNode("master", new LocalTransportAddress("master"), + emptyMap(), emptySet(), Version.CURRENT); + DiscoveryNode otherNode = new DiscoveryNode("other", new LocalTransportAddress("other"), emptyMap(), emptySet(), Version.CURRENT); DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().put(masterNode).put(otherNode).masterNodeId(masterNode.id()).build(); ClusterState clusterState = ClusterState.builder(new ClusterName("test")).nodes(discoveryNodes).build(); doc.setClusterState(clusterState); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java index 4948b53ee8d..1937ab9a410 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStatsResolverTests.java @@ -50,6 +50,8 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -60,7 +62,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa ClusterStatsMonitoringDoc doc = new ClusterStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setClusterStats(randomClusterStats()); return doc; } @@ -91,7 +93,8 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa */ private ClusterStatsResponse randomClusterStats() { ClusterStatsNodeResponse[] responses = { - new ClusterStatsNodeResponse(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, Version.CURRENT), + new ClusterStatsNodeResponse(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, + emptyMap(), emptySet(), Version.CURRENT), ClusterHealthStatus.GREEN, randomNodeInfo(), randomNodeStats(), randomShardStats()) }; return new ClusterStatsResponse(Math.abs(randomLong()), ClusterName.DEFAULT, UUID.randomUUID().toString(), responses); @@ -104,7 +107,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa BoundTransportAddress transportAddress = new BoundTransportAddress(new TransportAddress[]{DummyTransportAddress.INSTANCE}, DummyTransportAddress.INSTANCE); return new NodeInfo(Version.CURRENT, org.elasticsearch.Build.CURRENT, - new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, Version.CURRENT), Collections.emptyMap(), + new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT), emptyMap(), Settings.EMPTY, DummyOsInfo.INSTANCE, new ProcessInfo(randomInt(), randomBoolean()), JvmInfo.jvmInfo(), new ThreadPoolInfo(Collections.singletonList(new ThreadPool.Info("test_threadpool", ThreadPool.ThreadPoolType.FIXED, 5))), new TransportInfo(transportAddress, Collections.emptyMap()), new HttpInfo(transportAddress, randomLong()), @@ -122,7 +125,7 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa }; Map> statsByShard = new HashMap<>(); statsByShard.put(index, Collections.singletonList(new IndexShardStats(new ShardId(index, 0), randomShardStats()))); - return new NodeStats(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, Version.CURRENT), 0, + return new NodeStats(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT), 0, new NodeIndicesStats(new CommonStats(), statsByShard), null, null, null, null, new FsInfo(0, pathInfo), null, null, null, null, null, null); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java index 6ee4a599b02..b4643226244 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexRecoveryResolverTests.java @@ -20,6 +20,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -30,9 +32,9 @@ public class IndexRecoveryResolverTests extends MonitoringIndexNameResolverTestC IndexRecoveryMonitoringDoc doc = new IndexRecoveryMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); - DiscoveryNode localNode = new DiscoveryNode("foo", DummyTransportAddress.INSTANCE, Version.CURRENT); + DiscoveryNode localNode = new DiscoveryNode("foo", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT); Map> shardRecoveryStates = new HashMap<>(); shardRecoveryStates.put("test", Collections.singletonList(new RecoveryState(new ShardId("test", "uuid", 0), true, RecoveryState.Type.STORE, localNode, localNode))); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java index 01acb74f3d2..2146b4147f3 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndexStatsResolverTests.java @@ -34,6 +34,8 @@ import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCa import java.nio.file.Path; import java.util.UUID; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -44,7 +46,7 @@ public class IndexStatsResolverTests extends MonitoringIndexNameResolverTestCase IndexStatsMonitoringDoc doc = new IndexStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setIndexStats(randomIndexStats()); return doc; } @@ -57,7 +59,7 @@ public class IndexStatsResolverTests extends MonitoringIndexNameResolverTestCase public void testIndexStatsResolver() throws Exception { IndexStatsMonitoringDoc doc = newMarvelDoc(); doc.setTimestamp(1437580442979L); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); IndexStatsResolver resolver = newResolver(); assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java index a702eab9410..a15ff66f9ea 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/indices/IndicesStatsResolverTests.java @@ -38,6 +38,8 @@ import java.util.List; import java.util.UUID; import static java.util.Collections.emptyList; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -48,7 +50,7 @@ public class IndicesStatsResolverTests extends MonitoringIndexNameResolverTestCa IndicesStatsMonitoringDoc doc = new IndicesStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setIndicesStats(randomIndicesStats()); return doc; } @@ -62,7 +64,7 @@ public class IndicesStatsResolverTests extends MonitoringIndexNameResolverTestCa IndicesStatsMonitoringDoc doc = newMarvelDoc(); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(1437580442979L); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); IndicesStatsResolver resolver = newResolver(); assertThat(resolver.index(doc), equalTo(".monitoring-es-" + MarvelTemplateUtils.TEMPLATE_VERSION + "-2015.07.22")); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java index 9592399ff2c..179f9fd1f8e 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/DiscoveryNodeResolverTests.java @@ -18,6 +18,7 @@ import org.elasticsearch.test.VersionUtils; import java.util.UUID; import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; public class DiscoveryNodeResolverTests extends MonitoringIndexNameResolverTestCase { @@ -27,9 +28,9 @@ public class DiscoveryNodeResolverTests extends MonitoringIndexNameResolverTestC DiscoveryNodeMonitoringDoc doc = new DiscoveryNodeMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setNode(new DiscoveryNode(randomAsciiOfLength(3), UUID.randomUUID().toString(), - DummyTransportAddress.INSTANCE, emptyMap(), + DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), VersionUtils.randomVersionBetween(random(), VersionUtils.getFirstVersion(), Version.CURRENT))); return doc; } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java index 4fe42eec663..1eb80d4a59d 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/node/NodeStatsResolverTests.java @@ -47,6 +47,8 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; @@ -57,7 +59,7 @@ public class NodeStatsResolverTests extends MonitoringIndexNameResolverTestCase< NodeStatsMonitoringDoc doc = new NodeStatsMonitoringDoc(randomMonitoringId(), randomAsciiOfLength(2)); doc.setClusterUUID(randomAsciiOfLength(5)); doc.setTimestamp(Math.abs(randomLong())); - doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, Version.CURRENT)); + doc.setSourceNode(new DiscoveryNode("id", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT)); doc.setNodeMaster(randomBoolean()); doc.setNodeId(UUID.randomUUID().toString()); doc.setDiskThresholdDeciderEnabled(randomBoolean()); @@ -126,7 +128,7 @@ public class NodeStatsResolverTests extends MonitoringIndexNameResolverTestCase< new ThreadPoolStats.Stats(ThreadPool.Names.BULK, 0, 0, 0, 0, 0, 0), new ThreadPoolStats.Stats(ThreadPool.Names.SEARCH, 0, 0, 0, 0, 0, 0) ); - return new NodeStats(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, Version.CURRENT), 0, + return new NodeStats(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE, emptyMap(), emptySet(), Version.CURRENT), 0, new NodeIndicesStats(new CommonStats(), statsByShard), OsProbe.getInstance().osStats(), ProcessProbe.getInstance().processStats(), JvmStats.jvmStats(), new ThreadPoolStats(threadPoolStats), diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java index 173477327fc..f75452df163 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/shards/ShardsResolverTests.java @@ -19,6 +19,8 @@ import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCa import java.util.UUID; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; import static org.hamcrest.Matchers.equalTo; public class ShardsResolverTests extends MonitoringIndexNameResolverTestCase { @@ -29,7 +31,7 @@ public class ShardsResolverTests extends MonitoringIndexNameResolverTestCase