Rename static DiscoveryNode#dataNode(Settings) to isDataNode
This commit is contained in:
parent
2230fec9ea
commit
49e952e272
|
@ -72,7 +72,7 @@ public class DiscoveryNode implements Writeable<DiscoveryNode>, ToXContent {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -76,14 +76,14 @@ public class GatewayMetaState extends AbstractComponent implements ClusterStateL
|
|||
this.metaDataIndexUpgradeService = metaDataIndexUpgradeService;
|
||||
nodesListGatewayMetaState.init(this);
|
||||
|
||||
if (DiscoveryNode.dataNode(settings)) {
|
||||
if (DiscoveryNode.isDataNode(settings)) {
|
||||
ensureNoPre019ShardState(nodeEnv);
|
||||
}
|
||||
|
||||
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.dataNode(settings)) {
|
||||
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) {
|
||||
nodeEnv.ensureAtomicMoveSupported();
|
||||
}
|
||||
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.dataNode(settings)) {
|
||||
if (DiscoveryNode.isMasterNode(settings) || DiscoveryNode.isDataNode(settings)) {
|
||||
try {
|
||||
ensureNoPre019State();
|
||||
IndexFolderUpgrader.upgradeIndicesIfNeeded(settings, nodeEnv);
|
||||
|
|
|
@ -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.isMasterNode(settings)) {
|
||||
if (DiscoveryNode.isDataNode(settings) || DiscoveryNode.isMasterNode(settings)) {
|
||||
clusterService.add(this);
|
||||
}
|
||||
this.verifyAction = new VerifyNodeRepositoryAction(settings, transportService, clusterService, this);
|
||||
|
|
|
@ -108,7 +108,7 @@ public class SnapshotShardsService extends AbstractLifecycleComponent<SnapshotSh
|
|||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.threadPool = threadPool;
|
||||
if (DiscoveryNode.dataNode(settings)) {
|
||||
if (DiscoveryNode.isDataNode(settings)) {
|
||||
// this is only useful on the nodes that can hold data
|
||||
// addLast to make sure that Repository will be created before snapshot
|
||||
clusterService.addLast(this);
|
||||
|
|
|
@ -94,7 +94,7 @@ public final class ExternalTestCluster extends TestCluster {
|
|||
for (int i = 0; i < nodeInfos.getNodes().length; i++) {
|
||||
NodeInfo nodeInfo = nodeInfos.getNodes()[i];
|
||||
httpAddresses[i] = ((InetSocketTransportAddress) nodeInfo.getHttp().address().publishAddress()).address();
|
||||
if (DiscoveryNode.dataNode(nodeInfo.getSettings())) {
|
||||
if (DiscoveryNode.isDataNode(nodeInfo.getSettings())) {
|
||||
dataNodes++;
|
||||
masterAndDataNodes++;
|
||||
} else if (DiscoveryNode.isMasterNode(nodeInfo.getSettings())) {
|
||||
|
|
|
@ -1643,14 +1643,14 @@ public final class InternalTestCluster extends TestCluster {
|
|||
private static final class DataNodePredicate implements Predicate<NodeAndClient> {
|
||||
@Override
|
||||
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> {
|
||||
@Override
|
||||
public boolean test(NodeAndClient nodeAndClient) {
|
||||
return DiscoveryNode.dataNode(nodeAndClient.node.settings()) ||
|
||||
return DiscoveryNode.isDataNode(nodeAndClient.node.settings()) ||
|
||||
DiscoveryNode.isMasterNode(nodeAndClient.node.settings());
|
||||
}
|
||||
}
|
||||
|
@ -1672,7 +1672,7 @@ public final class InternalTestCluster extends TestCluster {
|
|||
@Override
|
||||
public boolean test(NodeAndClient nodeAndClient) {
|
||||
return DiscoveryNode.isMasterNode(nodeAndClient.node.settings()) == false &&
|
||||
DiscoveryNode.dataNode(nodeAndClient.node.settings()) == false;
|
||||
DiscoveryNode.isDataNode(nodeAndClient.node.settings()) == false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue