mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
Remove DiscoveryNodes#masterNode in favour of existing DiscoveryNodes#getMasterNode
Original commit: elastic/x-pack-elasticsearch@070850c49f
This commit is contained in:
parent
9f87fd5fc7
commit
9461dde896
@ -749,7 +749,7 @@ public class LicensesService extends AbstractLifecycleComponent<LicensesService>
|
|||||||
final ClusterState clusterState = clusterService.state();
|
final ClusterState clusterState = clusterService.state();
|
||||||
if (clusterService.lifecycleState() == Lifecycle.State.STARTED
|
if (clusterService.lifecycleState() == Lifecycle.State.STARTED
|
||||||
&& clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK) == false
|
&& 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);
|
final LicensesMetaData currentMetaData = clusterState.metaData().custom(LicensesMetaData.TYPE);
|
||||||
if (currentMetaData == null || currentMetaData.getLicense() == null) {
|
if (currentMetaData == null || currentMetaData.getLicense() == null) {
|
||||||
// triggers a cluster changed event
|
// triggers a cluster changed event
|
||||||
@ -762,7 +762,7 @@ public class LicensesService extends AbstractLifecycleComponent<LicensesService>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void requestTrialLicense(final ClusterState currentState) {
|
private void requestTrialLicense(final ClusterState currentState) {
|
||||||
DiscoveryNode masterNode = currentState.nodes().masterNode();
|
DiscoveryNode masterNode = currentState.nodes().getMasterNode();
|
||||||
if (masterNode == null) {
|
if (masterNode == null) {
|
||||||
throw new IllegalStateException("master not available when registering auto-generated license");
|
throw new IllegalStateException("master not available when registering auto-generated license");
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public class ClusterStateTests extends MarvelIntegTestCase {
|
|||||||
logger.debug("--> ensure that the 'nodes' attributes of the cluster state document is not indexed");
|
logger.debug("--> ensure that the 'nodes' attributes of the cluster state document is not indexed");
|
||||||
assertHitCount(client().prepareSearch().setSize(0)
|
assertHitCount(client().prepareSearch().setSize(0)
|
||||||
.setTypes(ClusterStateResolver.TYPE)
|
.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 {
|
public void testClusterStateNodes() throws Exception {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user