diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporters.java b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporters.java index aeadf2fff66..3db429fa5dd 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporters.java +++ b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/Exporters.java @@ -109,7 +109,7 @@ public class Exporters extends AbstractLifecycleComponent implements ExportBulk openBulk() { List bulks = new ArrayList<>(); for (Exporter exporter : exporters) { - if (exporter.masterOnly() && !clusterService.localNode().masterNode()) { + if (exporter.masterOnly() && !clusterService.localNode().isMasterNode()) { // the exporter is supposed to only run on the master node, but we're not // the master node... so skipping continue; diff --git a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporter.java b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporter.java index 06e500309b3..e012c9203eb 100644 --- a/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporter.java +++ b/elasticsearch/x-pack/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/local/LocalExporter.java @@ -7,7 +7,6 @@ package org.elasticsearch.marvel.agent.exporter.local; import com.carrotsearch.hppc.cursors.ObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; -import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse; @@ -24,8 +23,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.gateway.GatewayService; -import org.elasticsearch.marvel.MarvelSettings; -import org.elasticsearch.marvel.MonitoredSystem; import org.elasticsearch.marvel.agent.exporter.ExportBulk; import org.elasticsearch.marvel.agent.exporter.Exporter; import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils; @@ -151,7 +148,7 @@ public class LocalExporter extends Exporter implements ClusterStateListener, Cle // if this is not the master, we'll just look to see if the monitoring timestamped template is already // installed and if so, if it has a compatible version. If it is (installed and compatible) // we'll be able to start this exporter. Otherwise, we'll just wait for a new cluster state. - if (!clusterService.localNode().masterNode()) { + if (!clusterService.localNode().isMasterNode()) { // We only need to check the index template for timestamped indices if (!templateInstalled) { // the template for timestamped indices is not yet installed in the given cluster state, we'll wait. @@ -253,7 +250,7 @@ public class LocalExporter extends Exporter implements ClusterStateListener, Cle return; } - if (clusterService.localNode().masterNode()) { + if (clusterService.localNode().isMasterNode()) { // Reference date time will be compared to index.creation_date settings, // that's why it must be in UTC DateTime expiration = new DateTime(DateTimeZone.UTC).minus(retention.millis()); diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java index 66ae9e3595a..fdcdbc50730 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/ExportersTests.java @@ -228,7 +228,7 @@ public class ExportersTests extends ESTestCase { exporters.start(); DiscoveryNode localNode = mock(DiscoveryNode.class); - when(localNode.masterNode()).thenReturn(true); + when(localNode.isMasterNode()).thenReturn(true); when(clusterService.localNode()).thenReturn(localNode); ExportBulk bulk = exporters.openBulk(); @@ -252,7 +252,7 @@ public class ExportersTests extends ESTestCase { exporters.start(); DiscoveryNode localNode = mock(DiscoveryNode.class); - when(localNode.masterNode()).thenReturn(false); + when(localNode.isMasterNode()).thenReturn(false); when(clusterService.localNode()).thenReturn(localNode); ExportBulk bulk = exporters.openBulk(); diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistry.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistry.java index 4c0749067be..14949ba0cb9 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistry.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/support/WatcherIndexTemplateRegistry.java @@ -103,7 +103,7 @@ public class WatcherIndexTemplateRegistry extends AbstractComponent implements C } private void updateConfig(TemplateConfig config, Settings settings) { - if (clusterService.localNode().masterNode() == false) { + if (clusterService.localNode().isMasterNode() == false) { // Only the node that runs or will run Watcher should update the templates. Otherwise unnecessary put template // calls would happen return;