Skip to content

Commit

Permalink
Recover MasterEligible, but mark it is obsolete.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Fridlyand <yuryf@bitquilltech.com>
  • Loading branch information
Yury-Fridlyand committed Aug 9, 2022
1 parent d53df0d commit 2d6cff5
Show file tree
Hide file tree
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
Expand Up @@ -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)))
Expand Down
7 changes: 7 additions & 0 deletions src/OpenSearch.Net/ConnectionPool/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
2 changes: 2 additions & 0 deletions src/OpenSearch.Net/Responses/Sniff/SniffResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d6cff5

Please sign in to comment.