Skip to content

Commit 45c9637

Browse files
authored
Ensure IEphemeralCluster extends ICluster (#60)
1 parent b7c4dad commit 45c9637

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

src/Elastic.Elasticsearch.Ephemeral/IEphemeralCluster.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Elastic.Elasticsearch.Ephemeral
1010
{
11-
public interface IEphemeralCluster
11+
public interface IEphemeralCluster : ICluster
1212
{
1313
ICollection<Uri> NodesUris(string hostName = null);
1414
string GetCacheFolderName();

src/Elastic.Elasticsearch.Managed/ClusterBase.cs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,39 @@
1717

1818
namespace Elastic.Elasticsearch.Managed
1919
{
20-
public interface ICluster<out TConfiguration> : IDisposable
21-
where TConfiguration : IClusterConfiguration<NodeFileSystem>
20+
public interface ICluster
2221
{
22+
/// <summary>
23+
/// Whether known proxies were detected as running during startup
24+
/// </summary>
25+
DetectedProxySoftware DetectedProxy { get; }
26+
27+
/// <summary> A friendly name for this cluster, derived from the implementation name</summary>
2328
string ClusterMoniker { get; }
24-
TConfiguration ClusterConfiguration { get; }
29+
30+
/// <inheritdoc cref="INodeFileSystem"/>
2531
INodeFileSystem FileSystem { get; }
32+
33+
/// <summary> Indicating if this cluster was started correctly </summary>
2634
bool Started { get; }
35+
36+
/// <summary>
37+
/// The collection of <see cref="ElasticsearchNode"/>'s that make up the cluster
38+
/// </summary>
2739
ReadOnlyCollection<ElasticsearchNode> Nodes { get; }
40+
}
41+
42+
public interface ICluster<out TConfiguration> : ICluster,IDisposable
43+
where TConfiguration : IClusterConfiguration<NodeFileSystem>
44+
{
45+
TConfiguration ClusterConfiguration { get; }
2846
IConsoleLineHandler Writer { get; }
2947

3048
IDisposable Start();
3149

3250
IDisposable Start(TimeSpan waitForStarted);
3351

3452
IDisposable Start(IConsoleLineHandler writer, TimeSpan waitForStarted);
35-
36-
/// <summary>
37-
/// Whether known proxies were detected as running during startup
38-
/// </summary>
39-
DetectedProxySoftware DetectedProxy { get; }
4053
}
4154

4255

src/Elastic.Elasticsearch.Xunit/XunitClusterExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ namespace Elastic.Elasticsearch.Xunit
1313
/// </summary>
1414
public static class XunitClusterExtensions
1515
{
16-
private static readonly ConcurrentDictionary<IEphemeralCluster, object> Clients =
17-
new ConcurrentDictionary<IEphemeralCluster, object>();
16+
private static readonly ConcurrentDictionary<IEphemeralCluster, object> Clients = new();
1817

1918
/// <summary>
2019
/// Gets a client for the cluster if one exists, or creates a new client if one doesn't.

0 commit comments

Comments
 (0)