Rename static DiscoveryNode#dataNode(Settings) to isDataNode

This commit is contained in:
javanna 2016-03-30 14:58:28 +02:00 committed by Luca Cavanna
parent 2230fec9ea
commit 49e952e272
6 changed files with 10 additions and 10 deletions

View File

@ -72,7 +72,7 @@ public class DiscoveryNode implements Writeable<DiscoveryNode>, ToXContent {
return Node.NODE_MASTER_SETTING.get(settings); return Node.NODE_MASTER_SETTING.get(settings);
} }
public static boolean dataNode(Settings settings) { public static boolean isDataNode(Settings settings) {
return Node.NODE_DATA_SETTING.get(settings); return Node.NODE_DATA_SETTING.get(settings);
} }

View File

@ -76,14 +76,14 @@ public class GatewayMetaState extends AbstractComponent implements ClusterStateL
this.metaDataIndexUpgradeService = metaDataIndexUpgradeService; this.metaDataIndexUpgradeService = metaDataIndexUpgradeService;
nodesListGatewayMetaState.init(this); nodesListGatewayMetaState.init(this);
if (DiscoveryNode.dataNode(settings)) { if (DiscoveryNode.isDataNode(settings)) {
ensureNoPre019ShardState(nodeEnv); ensureNoPre019ShardState(nodeEnv);
} }
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.dataNode(settings)) { if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) {
nodeEnv.ensureAtomicMoveSupported(); nodeEnv.ensureAtomicMoveSupported();
} }
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.dataNode(settings)) { if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) {
try { try {
ensureNoPre019State(); ensureNoPre019State();
IndexFolderUpgrader.upgradeIndicesIfNeeded(settings, nodeEnv); IndexFolderUpgrader.upgradeIndicesIfNeeded(settings, nodeEnv);

View File

@ -77,7 +77,7 @@ public class RepositoriesService extends AbstractComponent implements ClusterSta
this.clusterService = clusterService; this.clusterService = clusterService;
// Doesn't make sense to maintain repositories on non-master and non-data nodes // Doesn't make sense to maintain repositories on non-master and non-data nodes
// Nothing happens there anyway // Nothing happens there anyway
if (DiscoveryNode.dataNode(settings) || DiscoveryNode.isMasterNode(settings)) { if (DiscoveryNode.isDataNode(settings) || DiscoveryNode.isMasterNode(settings)) {
clusterService.add(this); clusterService.add(this);
} }
this.verifyAction = new VerifyNodeRepositoryAction(settings, transportService, clusterService, this); this.verifyAction = new VerifyNodeRepositoryAction(settings, transportService, clusterService, this);

View File

@ -108,7 +108,7 @@ public class SnapshotShardsService extends AbstractLifecycleComponent<SnapshotSh
this.transportService = transportService; this.transportService = transportService;
this.clusterService = clusterService; this.clusterService = clusterService;
this.threadPool = threadPool; this.threadPool = threadPool;
if (DiscoveryNode.dataNode(settings)) { if (DiscoveryNode.isDataNode(settings)) {
// this is only useful on the nodes that can hold data // this is only useful on the nodes that can hold data
// addLast to make sure that Repository will be created before snapshot // addLast to make sure that Repository will be created before snapshot
clusterService.addLast(this); clusterService.addLast(this);

View File

@ -94,7 +94,7 @@ public final class ExternalTestCluster extends TestCluster {
for (int i = 0; i < nodeInfos.getNodes().length; i++) { for (int i = 0; i < nodeInfos.getNodes().length; i++) {
NodeInfo nodeInfo = nodeInfos.getNodes()[i]; NodeInfo nodeInfo = nodeInfos.getNodes()[i];
httpAddresses[i] = ((InetSocketTransportAddress) nodeInfo.getHttp().address().publishAddress()).address(); httpAddresses[i] = ((InetSocketTransportAddress) nodeInfo.getHttp().address().publishAddress()).address();
if (DiscoveryNode.dataNode(nodeInfo.getSettings())) { if (DiscoveryNode.isDataNode(nodeInfo.getSettings())) {
dataNodes++; dataNodes++;
masterAndDataNodes++; masterAndDataNodes++;
} else if (DiscoveryNode.isMasterNode(nodeInfo.getSettings())) { } else if (DiscoveryNode.isMasterNode(nodeInfo.getSettings())) {

View File

@ -1643,14 +1643,14 @@ public final class InternalTestCluster extends TestCluster {
private static final class DataNodePredicate implements Predicate<NodeAndClient> { private static final class DataNodePredicate implements Predicate<NodeAndClient> {
@Override @Override
public boolean test(NodeAndClient nodeAndClient) { public boolean test(NodeAndClient nodeAndClient) {
return DiscoveryNode.dataNode(nodeAndClient.node.settings()); return DiscoveryNode.isDataNode(nodeAndClient.node.settings());
} }
} }
private static final class DataOrMasterNodePredicate implements Predicate<NodeAndClient> { private static final class DataOrMasterNodePredicate implements Predicate<NodeAndClient> {
@Override @Override
public boolean test(NodeAndClient nodeAndClient) { public boolean test(NodeAndClient nodeAndClient) {
return DiscoveryNode.dataNode(nodeAndClient.node.settings()) || return DiscoveryNode.isDataNode(nodeAndClient.node.settings()) ||
DiscoveryNode.isMasterNode(nodeAndClient.node.settings()); DiscoveryNode.isMasterNode(nodeAndClient.node.settings());
} }
} }
@ -1672,7 +1672,7 @@ public final class InternalTestCluster extends TestCluster {
@Override @Override
public boolean test(NodeAndClient nodeAndClient) { public boolean test(NodeAndClient nodeAndClient) {
return DiscoveryNode.isMasterNode(nodeAndClient.node.settings()) == false && return DiscoveryNode.isMasterNode(nodeAndClient.node.settings()) == false &&
DiscoveryNode.dataNode(nodeAndClient.node.settings()) == false; DiscoveryNode.isDataNode(nodeAndClient.node.settings()) == false;
} }
} }