From 9461dde8967bf1431221c40951a9864fe6312afb Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 30 Mar 2016 15:19:41 +0200 Subject: [PATCH] Remove DiscoveryNodes#masterNode in favour of existing DiscoveryNodes#getMasterNode Original commit: elastic/x-pack-elasticsearch@070850c49f51be4da67066e216ec20f0a3b11504 --- .../elasticsearch/license/plugin/core/LicensesService.java | 4 ++-- .../marvel/agent/resolver/cluster/ClusterStateTests.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java index c6757bdbf79..fe0be8763b5 100644 --- a/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java +++ b/elasticsearch/x-pack/license-plugin/src/main/java/org/elasticsearch/license/plugin/core/LicensesService.java @@ -749,7 +749,7 @@ public class LicensesService extends AbstractLifecycleComponent final ClusterState clusterState = clusterService.state(); if (clusterService.lifecycleState() == Lifecycle.State.STARTED && clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK) == false - && clusterState.nodes().masterNode() != null) { + && clusterState.nodes().getMasterNode() != null) { final LicensesMetaData currentMetaData = clusterState.metaData().custom(LicensesMetaData.TYPE); if (currentMetaData == null || currentMetaData.getLicense() == null) { // triggers a cluster changed event @@ -762,7 +762,7 @@ public class LicensesService extends AbstractLifecycleComponent } private void requestTrialLicense(final ClusterState currentState) { - DiscoveryNode masterNode = currentState.nodes().masterNode(); + DiscoveryNode masterNode = currentState.nodes().getMasterNode(); if (masterNode == null) { throw new IllegalStateException("master not available when registering auto-generated license"); } diff --git a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java index 974201838ec..e020d163d29 100644 --- a/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java +++ b/elasticsearch/x-pack/marvel/src/test/java/org/elasticsearch/marvel/agent/resolver/cluster/ClusterStateTests.java @@ -100,7 +100,7 @@ public class ClusterStateTests extends MarvelIntegTestCase { logger.debug("--> ensure that the 'nodes' attributes of the cluster state document is not indexed"); assertHitCount(client().prepareSearch().setSize(0) .setTypes(ClusterStateResolver.TYPE) - .setQuery(matchQuery("cluster_state.nodes." + nodes.getMasterNodeId() + ".name", nodes.masterNode().getName())).get(), 0L); + .setQuery(matchQuery("cluster_state.nodes." + nodes.getMasterNodeId() + ".name", nodes.getMasterNode().getName())).get(), 0L); } public void testClusterStateNodes() throws Exception {