Rename DiscoveryNodes#masterAndDataNodes to getMasterAndDataNodes
This commit is contained in:
parent
4032859e90
commit
97f7aef776
|
@ -144,7 +144,7 @@ public class DiscoveryNodes extends AbstractDiffable<DiscoveryNodes> implements
|
|||
*
|
||||
* @return {@link Map} of the discovered master and data nodes arranged by their ids
|
||||
*/
|
||||
public ImmutableOpenMap<String, DiscoveryNode> masterAndDataNodes() {
|
||||
public ImmutableOpenMap<String, DiscoveryNode> getMasterAndDataNodes() {
|
||||
ImmutableOpenMap.Builder<String, DiscoveryNode> nodes = ImmutableOpenMap.builder(dataNodes);
|
||||
nodes.putAll(masterNodes);
|
||||
return nodes.build();
|
||||
|
|
|
@ -165,9 +165,9 @@ public class GatewayService extends AbstractLifecycleComponent<GatewayService> i
|
|||
DiscoveryNodes nodes = state.nodes();
|
||||
if (state.nodes().masterNodeId() == null) {
|
||||
logger.debug("not recovering from gateway, no master elected yet");
|
||||
} else if (recoverAfterNodes != -1 && (nodes.masterAndDataNodes().size()) < recoverAfterNodes) {
|
||||
} else if (recoverAfterNodes != -1 && (nodes.getMasterAndDataNodes().size()) < recoverAfterNodes) {
|
||||
logger.debug("not recovering from gateway, nodes_size (data+master) [{}] < recover_after_nodes [{}]",
|
||||
nodes.masterAndDataNodes().size(), recoverAfterNodes);
|
||||
nodes.getMasterAndDataNodes().size(), recoverAfterNodes);
|
||||
} else if (recoverAfterDataNodes != -1 && nodes.getDataNodes().size() < recoverAfterDataNodes) {
|
||||
logger.debug("not recovering from gateway, nodes_size (data) [{}] < recover_after_data_nodes [{}]",
|
||||
nodes.getDataNodes().size(), recoverAfterDataNodes);
|
||||
|
@ -185,9 +185,9 @@ public class GatewayService extends AbstractLifecycleComponent<GatewayService> i
|
|||
// one of the expected is set, see if all of them meet the need, and ignore the timeout in this case
|
||||
enforceRecoverAfterTime = false;
|
||||
reason = "";
|
||||
if (expectedNodes != -1 && (nodes.masterAndDataNodes().size() < expectedNodes)) { // does not meet the expected...
|
||||
if (expectedNodes != -1 && (nodes.getMasterAndDataNodes().size() < expectedNodes)) { // does not meet the expected...
|
||||
enforceRecoverAfterTime = true;
|
||||
reason = "expecting [" + expectedNodes + "] nodes, but only have [" + nodes.masterAndDataNodes().size() + "]";
|
||||
reason = "expecting [" + expectedNodes + "] nodes, but only have [" + nodes.getMasterAndDataNodes().size() + "]";
|
||||
} else if (expectedDataNodes != -1 && (nodes.getDataNodes().size() < expectedDataNodes)) { // does not meet the expected...
|
||||
enforceRecoverAfterTime = true;
|
||||
reason = "expecting [" + expectedDataNodes + "] data nodes, but only have [" + nodes.getDataNodes().size() + "]";
|
||||
|
|
|
@ -71,7 +71,7 @@ public class VerifyNodeRepositoryAction extends AbstractComponent {
|
|||
final DiscoveryNodes discoNodes = clusterService.state().nodes();
|
||||
final DiscoveryNode localNode = discoNodes.localNode();
|
||||
|
||||
final ObjectContainer<DiscoveryNode> masterAndDataNodes = discoNodes.masterAndDataNodes().values();
|
||||
final ObjectContainer<DiscoveryNode> masterAndDataNodes = discoNodes.getMasterAndDataNodes().values();
|
||||
final List<DiscoveryNode> nodes = new ArrayList<>();
|
||||
for (ObjectCursor<DiscoveryNode> cursor : masterAndDataNodes) {
|
||||
DiscoveryNode node = cursor.value;
|
||||
|
|
Loading…
Reference in New Issue