From 2230fec9ea75c0725bf57995bd28312ec19bc259 Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 30 Mar 2016 14:57:36 +0200 Subject: [PATCH] Rename static DiscoveryNode#masterNode(Settings) to isMasterNode --- .../java/org/elasticsearch/cluster/node/DiscoveryNode.java | 2 +- .../main/java/org/elasticsearch/gateway/GatewayMetaState.java | 4 ++-- .../org/elasticsearch/repositories/RepositoriesService.java | 2 +- .../org/elasticsearch/snapshots/SnapshotShardsService.java | 2 +- .../java/org/elasticsearch/snapshots/SnapshotsService.java | 2 +- .../main/java/org/elasticsearch/test/ExternalTestCluster.java | 3 +-- .../main/java/org/elasticsearch/test/InternalTestCluster.java | 4 ++-- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java b/core/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java index 340e00a71f3..31a0f91ea38 100644 --- a/core/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java +++ b/core/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java @@ -68,7 +68,7 @@ public class DiscoveryNode implements Writeable, ToXContent { return Node.NODE_DATA_SETTING.get(settings) || Node.NODE_MASTER_SETTING.get(settings); } - public static boolean masterNode(Settings settings) { + public static boolean isMasterNode(Settings settings) { return Node.NODE_MASTER_SETTING.get(settings); } diff --git a/core/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java b/core/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java index 22c3287f31c..52aa8cefdbf 100644 --- a/core/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java +++ b/core/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java @@ -80,10 +80,10 @@ public class GatewayMetaState extends AbstractComponent implements ClusterStateL ensureNoPre019ShardState(nodeEnv); } - if (DiscoveryNode.masterNode(settings) || DiscoveryNode.dataNode(settings)) { + if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.dataNode(settings)) { nodeEnv.ensureAtomicMoveSupported(); } - if (DiscoveryNode.masterNode(settings) || DiscoveryNode.dataNode(settings)) { + if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.dataNode(settings)) { try { ensureNoPre019State(); IndexFolderUpgrader.upgradeIndicesIfNeeded(settings, nodeEnv); diff --git a/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java b/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java index 8c6ab070fc6..384a375903a 100644 --- a/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java +++ b/core/src/main/java/org/elasticsearch/repositories/RepositoriesService.java @@ -77,7 +77,7 @@ public class RepositoriesService extends AbstractComponent implements ClusterSta this.clusterService = clusterService; // Doesn't make sense to maintain repositories on non-master and non-data nodes // Nothing happens there anyway - if (DiscoveryNode.dataNode(settings) || DiscoveryNode.masterNode(settings)) { + if (DiscoveryNode.dataNode(settings) || DiscoveryNode.isMasterNode(settings)) { clusterService.add(this); } this.verifyAction = new VerifyNodeRepositoryAction(settings, transportService, clusterService, this); diff --git a/core/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java b/core/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java index 9a0cc0f8cb0..000c387cc82 100644 --- a/core/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java +++ b/core/src/main/java/org/elasticsearch/snapshots/SnapshotShardsService.java @@ -114,7 +114,7 @@ public class SnapshotShardsService extends AbstractLifecycleComponent { @Override public boolean test(NodeAndClient nodeAndClient) { - return DiscoveryNode.masterNode(nodeAndClient.node.settings()) == false && + return DiscoveryNode.isMasterNode(nodeAndClient.node.settings()) == false && DiscoveryNode.dataNode(nodeAndClient.node.settings()) == false; } }