Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from Bit-Quill/dev-recover-MasterEligible
Browse files Browse the repository at this point in the history
Recover `MasterEligible`
Yury-Fridlyand authored Aug 15, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents a88e99b + 2d6cff5 commit 13bf5d4
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/OpenSearch.Net.VirtualizedCluster/VirtualCluster.cs
Original file line number Diff line number Diff line change
@@ -76,6 +76,12 @@ public VirtualCluster ClusterManagerEligible(params int[] ports)
return this;
}

[Obsolete("Use ClusterManagerEligible instead", false)]
public VirtualCluster MasterEligible(params int[] ports)
{
return ClusterManagerEligible(ports);
}

public VirtualCluster StoresNoData(params int[] ports)
{
foreach (var node in _nodes.Where(n => ports.Contains(n.Uri.Port)))
7 changes: 7 additions & 0 deletions src/OpenSearch.Net/ConnectionPool/Node.cs
Original file line number Diff line number Diff line change
@@ -77,8 +77,15 @@ public Node(Uri uri)
/// <summary>Indicates whether this node is cluster_manager eligible, defaults to true when unknown/unspecified</summary>
public bool ClusterManagerEligible { get; set; }

/// <summary> Renamed to <see cref="ClusterManagerEligible"/> as of OpenSearch 2.0</summary>
[Obsolete("Use ClusterManagerEligible instead", false)]
public bool MasterEligible { get => ClusterManagerEligible; set => ClusterManagerEligible = value; }

public bool ClusterManagerOnlyNode => ClusterManagerEligible && !HoldsData;

[Obsolete("Use ClusterManagerOnlyNode instead", false)]
public bool MasterOnlyNode => ClusterManagerOnlyNode;

/// <summary>The name of the node, defaults to null when unknown/unspecified</summary>
public string Name { get; set; }

2 changes: 2 additions & 0 deletions src/OpenSearch.Net/Responses/Sniff/SniffResponse.cs
Original file line number Diff line number Diff line change
@@ -116,6 +116,8 @@ internal bool HttpEnabled
internal bool IngestEnabled => roles?.Contains("ingest") ?? false;

internal bool ClusterManagerEligible => (roles == null ? false : roles.Contains("master") || roles.Contains("cluster_manager"));
[Obsolete("Use ClusterManagerEligible instead", false)]
internal bool MasterEligible => ClusterManagerEligible;
}

internal class NodeInfoHttp

0 comments on commit 13bf5d4

Please sign in to comment.